We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

36-Reading Text Files

The My.Computer.FileSystem object has a method that allows you to read a text file and it is called the ReadAllText.  The encoding file can be specified if the file contains an encoding text such as ASCII or UTF-8.


You need to specify the encoding file , if you are reading from a file with an extended characters.



  1. <pre>Dim fReader As String
  2. fReader = My.Computer.FileSystem.ReadAllText("C:\testfile.txt")
  3. MsgBox(fReader)

Example of Encoding File:

  1. Dim fReader As String
  2. fReader = My.Computer.FileSystem.ReadAllText("C:\testfile.txt",
  3.    System.Text.Encoding.UTF32)
  4. MsgBox(fReader)
Facebook Comments
(Visited 1 times, 1 visits today)
Share this

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked * © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!

%d bloggers like this: