[HOW TO] Read a text file (.txt) to a textbox menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    Ebonesser's Avatar Member
    Reputation
    33
    Join Date
    Mar 2009
    Posts
    123
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HOW TO] Read a text file (.txt) to a textbox

    Here's a way to read a text file (.txt) to a textbox in a form

    VB6:
    Dim fso, f
    Const ForReading = 1
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.opentextfile(App.Path & "\YourTextFile.txt", ForReading)
    Text1.Text = f.read(100000)
    VB 2005+:
    Dim sFname As String
    sFname = My.Application.Info.DirectoryPath & "\YourTextFile.txt"

    If Not FileExist(My.Application.Info.DirectoryPath & "\YourTextFile.txt") Then

    Else
    TextBox1.Text = IO.File.ReadAllText(My.Application.Info.DirectoryPath & "\YourTextFile.txt")
    End If
    I hope you find it useful

    //Ebonesser
    Last edited by Ebonesser; 06-19-2009 at 05:39 PM.

    [HOW TO] Read a text file (.txt) to a textbox

Similar Threads

  1. Replies: 2
    Last Post: 10-03-2011, 10:37 AM
  2. Reading a text file from a WoW addon
    By kixer in forum Programming
    Replies: 3
    Last Post: 10-25-2010, 08:36 AM
  3. VB 2008; How to add text from text file to combobox
    By Flame_Warrior in forum Programming
    Replies: 9
    Last Post: 07-14-2009, 03:58 AM
  4. how to import a text file?
    By lethalllama in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 08-23-2008, 03:44 AM
  5. how to change a text file for a itmem to a sql file
    By lolzz in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-12-2008, 01:18 AM
All times are GMT -5. The time now is 08:54 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search