Text File To Binary File in VB.net

View previous topic View next topic Go down

Text File To Binary File in VB.net

Post  Admin on Thu Jan 29, 2009 4:00 pm

Public Sub BinarySerialize()
'Create a streamreader class
Dim objStreamReader As StreamReader
'open the file
objStreamReader = File.OpenText("c:\\Mystore1.txt")
'Read the file storing it in the readfile string
Dim readfile As String = objStreamReader.ReadToEnd()
Dim flStream As FileStream = New FileStream("c:\\myStore.txt", FileMode.OpenOrCreate, FileAccess.Write)
Try
Dim bFormatter As BinaryFormatter = New BinaryFormatter
bFormatter.Serialize(flStream, readfile)
Finally
flStream.Close()
objStreamReader.Close()
End Try
End Sub
avatar
Admin
Admin

Posts : 256
Join date : 2008-06-06

View user profile http://debmedia.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum