Reads from a text file.
String containing the contents of the file.
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.