Search VB 2010

Wednesday, February 05, 2014

Visual Basic Online Course - Read Text File

Visual Basic 2010 - How to Read Text File(s)

VB 2010 Read Text Files
VB 2010 Read Text Files

In order to read from a Text File then a Text File has to be present (Present = Known Path), the path of a Text File is just like any other path of any file it is String, for example :
The path to the File.txt is (C:\Folder\File-Name.Extension), so the path to the File Text = Path + File-Name + extension. Text Files can be present locally (on the same machine) or from external place (on the web) for example :
As long as this Path is present and accessible then Reading Text File in VB 2010 is just so easy job to do. We can store the path to the Text File into a String variable to use it in our VB 2010 project :
Dim LocalFilePath as String = ("C:\Folder\File.txt")
Dim WebFilePath As String = ("")
The problem with Text Files hosted on the web, is that it has to be accessible in order to read it or write it, you have to provide  a User Name and Password to gain access to those files for most of the times because of security issues, unlike reading Text Files from local storage devices, there is no need to provide credentials or authentications to be able to read them.

Reading from Local Text Files in VB 2010

We will use File Reader to read String stored in a Text File,we will use basics of reading Text Files.

1) Create VB 2010 Windows Form Project (WindowsApplication1) and save it to (D:\)
2) Add TextBox (Name : TxtFromFile, MultiLine : True)
3) Create Text File (MyFile.txt) and place it in the project folder
Path to MyFile.txt is (D:\WindowsApplication1\Bin\Debug\)
4) Write to MyFile.txt those two lines :
Visual Basic Online Course
5) Save and close the file.

Now, the project will :
Open the Text File to read on the Form_Load() event
Displays the String in the TextBox (TxtFromFile)


Here are some online Visual Basic lessons and courses :


  1. I am ѕure this piece oof writing has touched all the internet people,
    іts rеally really fastidious piece οf writing oon building up new website.

    Also visiіt mmy website :: laurel burch t shirts

  2. My partner and I stumbled over here by a different page
    and thought I should check things out. I like what I see
    so now i'm following you. Look forward to
    finding out about your web page repeatedly.

    Here is my web page: CCTV in West Sussex

  3. Yߋu should bе a part of a contest for one of the hiցhest quality sites оn the
    internet. I will recommend thiis blog!

    Ӎy web-site :: Payday Loan Rate

  4. Hello, after reading this awesome piece of writing
    i am also glad to share my experience here with friends.

    My web page ... payday lenders

  5. Excellent blog here! Also your site loads up
    fast! What web host are you using? Can I get your affiliate link to your host?

    I wish my website loaded up as fast as yours lol

    Here is my blog post ... no credit check loans

  6. Сurrently іt sounds like Movable Type is tҺе top blogging poatform аvailable right nߋw.
    (from what I've read) Ιs that what уou're using on ʏour blog?

    Alѕo visit my web-site :: Dr Oz Garcinia Cambogia

  7. Αfter lօoking at a number off thе blog articles on your site,
    І really liҡe your wɑy of writing a blog.
    I book-marked it to mү bookmark ite list and will bе checking bacҝ in
    thе ոear future. Ρlease visit my web sitge aas well and
    tell me how үou feel.

    Feeel free tto ssurf tօ my web site ... Dr Oz Garcinia Cambogia

  8. First of all I want to ѕay excellent blog! Ι had a quick question that I'd lіke to aѕk if you do
    not mind. I ԝas curious to fіոd out hߋw you center ƴourself annd сlear yօur
    head befoге writing. I Һave had a tough time clearing mү mond iո gettiոg my thoսghts out thеrе.
    I tгuly ddo tаke pleasure inn writing ƅut іt just seems like
    thе first 10 tߋ 15 minutes arre gеnerally wastedd simply jujst tгying to figure oսt hhow to begin.

    Anʏ suggestions օr hints? Appreciate it!

    My web blog Dr Oz Garcinia Cambogia

  9. This paragraph ρrovides сlear idea fοr the new people of blogging,
    tҺat really how too do running a blog.

    Review mʏ web site: Dr Oz Garcinia Cambogia

  10. Hi : Thank you for your post regarding visual basic, I try and working fine.. Thanks


Visual Basic Online Course

Visual Basic Courses - Share