FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

VB 6.0 need help loading a .txt file into a text box

 


andy26
im using this code to save to a .txt file
Code:
Public Sub ftpthing()
Path = App.Path & ("/urldat")
Title = urldat
Text = Form5.txtftpu.Text

Open Path & Title & ".txt" For Output As #1
    Print #1, Text
Close #1
End Sub


but i now need a code to load the .txt back into a text box.
i need some help on how to do so iv tried a few things and have failed.
thanks in advance
Trickster
Okay this should pretty much work for you:

Code:
Public Sub load_ftpthing()
Dim Path, Title, Text As String

Path = App.Path & ("/urldat")
Title = urldat

Open Path & Title & ".txt" For Input As #1 'Opens your desired textfile.
    Do While Not EOF(1) 'Runs a loop for each line until end of file is reached.
        Line Input #1, Text 'Each line is set to the string variable "Text".
            TXT_Textbox.Text = TXT_Textbox.Text & Text & Chr(13) & Chr(10) 'Adds each line from the "Text" variable to the textbox, and moves to next line.
    Loop
Close #1
End Sub
andy26
thanks
Trickster
You're welcome Wink
gibbo
I use this code
Code:
Public Sub ftpthing()
Dim usr As String
Open App.Path & "\userdat.txt" For Input As #1
usr = Input(LOF(1), 1)
Close #1
Form5.ftpthing.Text = usr
Related topics

VB 6.0 saving multipul .txt from a text box need help
Need help fixing my php file
VisualBasic 6.0 Help
VB 6.0 need code to hide a appliction
Saving a .txt file to a ftp using vb6. i need help please

how to check if a file exists. please help (visual basics 6)
need help with a script for vb its not to hard i think
Reading from text file into Flash
Need help with logger script. (half done)
VB Help for those who need small pointers in Visual Basic

is it possible to get a html text box to load a .txt file?
Need help loading an external .swf into an empty movieclip
Need help with mail.everyone.net
Create a txt file
Need help in Borland C++ 3.0
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.