I have this code below where I use the method ->ReadToEnd() to read in the whole file into the String test.
The thing is that I have to use the method ->ReadToEnd() in this case because I use another class that only have this functionality. I cant read line by line with that class.
The file I red consists of lines and are 60MB large. If I would read this file with StreamReader line by line, it takes exactly 0.2 seconds. Speed is important in this case.
How is it possible to read the String^ test line by line into the List<String^> getLines as fast as possible?
String^ filePath = "D:\\Folder1\\myTestFile.txt"; StreamReader^ rd = gcnew StreamReader(filePath); List<String^> getLines = gcnew List<String^>(); String^ test = rd->ReadToEnd(); rd->Close();