'這裡需要一個Button
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show(GetTextString)
End Sub
Private Function GetTextString() As String
Dim value As String = ""
Dim a As String = ""
Dim MySF As StreamReader = New StreamReader("c:\1.txt", System.Text.Encoding.Default)
'value = MySF.ReadToEnd() '讀取全部會包含換行符號
Do While Not MySF.EndOfStream
value &= MySF.ReadLine '讀取單行
Loop
Return value
End Function
沒有留言:
張貼留言