S
Saga
Hello all. I am using VB 2008 and need to process text fies. Looking
at MSDN Lib I see that two methods are used to read a text file:
Using StreamReader
Dim fileReader As System.IO.StreamReader
Using ReadAlltext
Dim fileReader As String
fileReader = My.Computer.FileSystem.ReadAllText("C:\test.txt")
Is one preferred obver the other? Any considerations I should look into?
Although the files that will be processed are text, I have seen a "bad"
non ASCII character get into them. I validate for this condition, but
given the fact that it is a non ASCII char, will either of the two methods
work or do I need to rethink the way that I open & read the files?
Thanks much! Saga
at MSDN Lib I see that two methods are used to read a text file:
Using StreamReader
Dim fileReader As System.IO.StreamReader
Using ReadAlltext
Dim fileReader As String
fileReader = My.Computer.FileSystem.ReadAllText("C:\test.txt")
Is one preferred obver the other? Any considerations I should look into?
Although the files that will be processed are text, I have seen a "bad"
non ASCII character get into them. I validate for this condition, but
given the fact that it is a non ASCII char, will either of the two methods
work or do I need to rethink the way that I open & read the files?
Thanks much! Saga