Hello,
I am not sure if this makes sense or not, but I need to process raw text (without any encoding?) that I retrieved from a file recovery application "PhotoRec".
With an application like Notepad++ I can see all of the text I need to manipulate but with VB I seem to only get some of the text with other stuff stripped out.
Here is what I am using to process the file:
I essentially add each line of text to the collection so I can read each line at a time (other processing, etc.)
So, as mentioned, with the above code I get text but not all of it. With different encodings I get different versions of the text represented in "currentbyte".
So, how can my .NET application read text like Notepad++ or a similar "raw" text reader app?
Thanks.
Regards,
Chris K.
I am not sure if this makes sense or not, but I need to process raw text (without any encoding?) that I retrieved from a file recovery application "PhotoRec".
With an application like Notepad++ I can see all of the text I need to manipulate but with VB I seem to only get some of the text with other stuff stripped out.
Here is what I am using to process the file:
VB.NET:
Dim objFileReader As FileStream = System.IO.File.OpenRead(FilePath)
Dim currentByte(2048) As Byte
Dim tempUTFEncoding As System.Text.ASCIIEncoding = New System.Text.ASCIIEncoding
If File Is Nothing Then
File = New Collection
End If
Do While objFileReader.Read(currentByte, 0, currentByte.Length) > 0
File.Add(tempUTFEncoding.GetString(currentByte))
Loop
I essentially add each line of text to the collection so I can read each line at a time (other processing, etc.)
So, as mentioned, with the above code I get text but not all of it. With different encodings I get different versions of the text represented in "currentbyte".
So, how can my .NET application read text like Notepad++ or a similar "raw" text reader app?
Thanks.
Regards,
Chris K.