I got an OEM file and I use a StreamReader to read it but I got a problem
that the file may got some characters that StreamReader can not read so it
reads only some data of it.
eg.
Dim StreamToDisplay As New StreamReader("C:\OEMFILE.DAT", _
Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.OEMCodePage))
Dim aLine As String
Do
aLine = StreamToDisplay.ReadLine
TextBox1.Text += aLine + Chr(13) + Chr(10)
Loop Until aLine = Nothing
StreamToDisplay.Close()
When it ends then I see at the TextBox that the file is has not be read
right. I tried the FileOpen method but the same problem occured.
The encoding is correct cause when I open the OEMFILE.DAT through the
Notepad and simple save it with the same name then the StreamReader can read
it correct. But the point is that it must be done without the help of the
Notepad.
Any help ?
Jorge Serrano [MVP VB] - 27 Oct 2004 18:29 GMT
Hi Rastarizer,
I hope that this thread help you;
http://www.dotnet247.com/247reference/msgs/54/270997.aspx
Kind Regards,
Jorge Serrano Pérez
MVP VB.NET
> I got an OEM file and I use a StreamReader to read it but I got a problem
> that the file may got some characters that StreamReader can not read so it
[quoted text clipped - 19 lines]
>
> Any help ?