Jody:
Dim lsFileContent as String
'Opens the file name referred to as sFileName.
Dim lfsTemp = New FileStream(sFileName, IO.FileMode.Open)
'Creates a Binary reader object.
Dim lbrTemp = New BinaryReader(lfsTemp)
'Reads all the bytes.
Dim lbTemp = lbrTemp.ReadBytes(lbrTemp.BaseStream.Length)
' Since I am reading bytes, they could also be multi-byte and
' this method uses the encoding to convert the bytes read to a
string
lsFileContent = System.Text.Encoding.Default.GetString(lbTemp)
lfsTemp.Close
lbrTemp.Close
Hope this helps.
Venki
"Jody" wrote:
How do you open a sequential file in vb.net using the OpenFileDialog and read from it? Also, how do you create a file, write to it, and save it?
From http://www.developmentnow.com/g/38_2...nguages-vb.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com