Tips and tricks for .NET using ASP and VB code.

Get text from a file and create an array of the lines of text

Dim FileContents As String = My.Computer.FileSystem.ReadAllText("C:\Temp\Temp.txt")
Dim FileLines() As String = FileContents.Split(ControlChars.CrLf, Integer.MaxValue, StringSplitOptions.RemoveEmptyEntries)

No comments:

Post a Comment

Search This Blog