Läsa in textfil med vb.net
Först så skriver vi detta längst upp av allt:
Imports System.IO
Denna rad öppnar textfilen:
Dim ioFile as new StreamReader(”TextFile.txt”)
Dessa rader loopar igenom hela filen:
Dim ioLine as string ’ Going to hold one line at a time
Dim ioLines as string ’ Going to hold whole file
ioLine = ioFile.ReadLine
ioLines = ioLine
While not ioLine = ””
ioLine = ioFile.ReadLine
ioLines = ioLines & vbcrlf & ioLine
End While
Detta skriver ut filen i en msgbox:
MsgBox(ioLines)