I have a text file with about 6k lines of short strings, each on its own line, added to my project's resources and I'm trying to .add each line to a collection. I've tried about 7 or 8 things, not all using StreamReader, but I can't find documentation on this anywhere.
Here is the last thing I tried:
Dim JunkStrings As New Collection Dim sr As StreamReader = New StreamReader(My.Resources.shorts) Do While sr.Peek() >= 0 JunkStrings.Add(sr.ReadLine()) Loop sr.Close()
As just a .txt file on my hard drive, this is what I was doing:
Dim TheFileName As String Dim JunkStrings As New Collection Dim LineofText As String TheFileName = "shorts.txt" FileOpen(1, TheFileName, OpenMode.Input) Do Until EOF(1) LineofText = LineInput(1) JunkStrings.Add(LineofText) Loop FileClose(1)
I just can't find the equivalent to this that reads lines from a text file out of my.resources. Any help would be greatly appreciated!