VB.NET - Code Samples - Read a text file in vb.net 2005

VB.NET 2005 Read a Text File


VB.NET 2005 My namespace provides a simple way to read a text file

The Solution:

VB.NET 2005 has simplified many routine programming tasks using the My Namespace. One of the many things it simplifies is reading a text file.

The Code:

	Dim fileText as string = My.Computer.FileSystem.ReadAllText("c:\AnyFile.txt")

About this page: