Imports System.Text
Imports System.IO
Public Class Tester
Public Shared Sub Main
Dim myFileStream As New FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite)
Dim bteRead() As Byte
Dim strRead As String
Dim lngRead As Long
lngRead = myFileStream.Length
ReDim bteRead(lngRead)
myFileStream.Read(bteRead, 0, lngRead)
strRead = Encoding.Unicode.GetString(bteRead)
Console.WriteLine(strRead)
myFileStream.Close()
End Sub
End Class
|