In The Hand LtdIn The Hand
ReadAllText Method (file, encoding)
NamespacesInTheHand.VisualBasic.MyServicesFileSystemProxyReadAllText(String, Encoding)
.NET Components for Mobility
Reads from a text file.
Declaration Syntax
C#Visual Basic
public string ReadAllText(
	string file,
	Encoding encoding
)
Public Function ReadAllText ( _
	file As String, _
	encoding As Encoding _
) As String
Parameters
file (String)
Name and path of the file to read.
encoding (Encoding)
Character encoding to use in reading the file. Default is UTF-8.
Return Value
String containing the contents of the file.
Remarks
The ReadAllText method of the My.Computer.FileSystem object allows you to read from a text file. The contents of the file are returned as a string.

The file encoding can be specified if the contents of the file are in an encoding such as ASCII or UTF-8. If you are reading from a file with extended characters, you need to specify the file encoding.

Do not make decisions about the contents of the file based on the name of the file. For example, the file Form1.vb may not be a Visual Basic source file. Verify all inputs before using the data in your application.

Assembly: InTheHand.VisualBasic (Module: InTheHand.VisualBasic) Version: 7.0.0.0