I want to read it line by line. If there is 10 lines, then the array should be size = 10
I have the following code, but I do not know how to NOT preset the array size
Code:Public Function MyReadLine(ByVal FileLoc As String) As String Dim AllText As String = "", LineOfText As String = "" Dim StreamToDisplay As StreamReader StreamToDisplay = My.Computer.FileSystem.OpenTextFileReader(FileLoc) Do Until StreamToDisplay.EndOfStream 'read lines from file LineOfText = StreamToDisplay.ReadLine() AllText = AllText & LineOfText & vbCrLf Loop Return AllText 'display file End Function


Reply With Quote
