Reads the remainder of the text file and returns it as a string.
Dim value As String = TextFieldParserObject.ReadToEnd()
Public Function ReadToEnd() As String
This is an advanced member; it does not show in IntelliSense unless you click the All tab.
If there is nothing more to read because the end of the file has been reached, Nothing is returned.
The ReadToEnd method does not ignore blank lines and comments.
This example uses the ReadToEnd method to read the entire file ParserText.txt and write it to the file Testfile.txt.
Using FileReader As New _
Dim allText As String = FileReader.ReadToEnd
My.Computer.FileSystem.WriteAllText("C://testfile.txt", allText, True)
If Testfile.txt does not exist, it is created by the WriteAllText method.
No permissions are required.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback