Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
readtext("D:\jhhj\readme.txt")
End Sub
Private Sub readtext(ByVal filename As String)
'读取指定文本文件_jm_ok
Dim fs As IO.FileStream
Dim r As IO.BinaryReader
Try
fs = New IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read, FileShare.ReadWrite)
r = New IO.BinaryReader(fs)
TextBox1.Text = System.Text.Encoding.GetEncoding("gb2312").GetString(r.ReadBytes(fs.Length), 0, fs.Length)
Catch
End Try
End Sub
readtext("D:\jhhj\readme.txt")
End Sub
Private Sub readtext(ByVal filename As String)
'读取指定文本文件_jm_ok
Dim fs As IO.FileStream
Dim r As IO.BinaryReader
Try
fs = New IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read, FileShare.ReadWrite)
r = New IO.BinaryReader(fs)
TextBox1.Text = System.Text.Encoding.GetEncoding("gb2312").GetString(r.ReadBytes(fs.Length), 0, fs.Length)
Catch
End Try
End Sub