hg
2006-08-30 03:05:01 UTC
請問一下,我寫asp.net讀取txt檔(程式如下),為何txt檔的第一行都讀不到,只能從第二行開始讀取,煩請解答
謝謝!!
Dim myFile As System.IO.File
Dim FileStream As System.IO.Stream
Dim MyStreamReader As System.IO.StreamReader
FileStream = myFile.OpenRead("E:\web\file\test.txt")
MyStreamReader = New System.IO.StreamReader(FileStream,
System.Text.Encoding.Default)
Dim RecLine As String = MyStreamReader.ReadLine
While Not (RecLine Is Nothing)
RecLine = MyStreamReader.ReadLine
response.Write( RecLine & "<br>" )
End While
謝謝!!
Dim myFile As System.IO.File
Dim FileStream As System.IO.Stream
Dim MyStreamReader As System.IO.StreamReader
FileStream = myFile.OpenRead("E:\web\file\test.txt")
MyStreamReader = New System.IO.StreamReader(FileStream,
System.Text.Encoding.Default)
Dim RecLine As String = MyStreamReader.ReadLine
While Not (RecLine Is Nothing)
RecLine = MyStreamReader.ReadLine
response.Write( RecLine & "<br>" )
End While