A
Anil Gupte
I am learning how to read and write files. Text files were easy, but binary
files have me confused. As per the tutorial, I used BinaryReader to read a
file and put the contents into a ByteArray:
Dim fsReadStream As New FileStream(MyFileName, FileMode.Open,
FileAccess.Read)
Dim brReader As New BinaryReader(fsReadStream)
Dim ByteArray() As Byte
While brReader.PeekChar() > -1
ByteArray = brReader.ReadBytes(1)
' This is the part where I don't know how to do
End While
brReader.Close()
How do I actually use the data in that ByteArray. I have basically created
a file containing some text, some images and some video (I plan to encrypt
this later). Now I want to open the file and read it, then parse it, put
the text into a label, put the image into a picturebox etc. Any tutorials
you can point me to, or any information at all will be useful.
Thanx,
files have me confused. As per the tutorial, I used BinaryReader to read a
file and put the contents into a ByteArray:
Dim fsReadStream As New FileStream(MyFileName, FileMode.Open,
FileAccess.Read)
Dim brReader As New BinaryReader(fsReadStream)
Dim ByteArray() As Byte
While brReader.PeekChar() > -1
ByteArray = brReader.ReadBytes(1)
' This is the part where I don't know how to do
End While
brReader.Close()
How do I actually use the data in that ByteArray. I have basically created
a file containing some text, some images and some video (I plan to encrypt
this later). Now I want to open the file and read it, then parse it, put
the text into a label, put the image into a picturebox etc. Any tutorials
you can point me to, or any information at all will be useful.
Thanx,