Valhalla Legends Archive

Programming => General Programming => Topic started by: Crypticflare on January 25, 2003, 01:46 PM

Title: Using Inputbox to retrieve Data saved in a .txt
Post by: Crypticflare on January 25, 2003, 01:46 PM
Private Sub mnuOpen_Click()
Dim PrgName As String
Dim Username As String
Dim Passwrd As String

Open (App.Path & "\Data\" & txtProg.Text & ".txt") For Input As #1
Input #1, strblank
Input #1, PrgName
txtProg.Text = PrgName
Input #1, strblank
Input #1, Username
txtUsername.Text = Username
Input #1, strblank
Input #1, Passwrd
txtPW.Text = Passwrd

End Sub

Now to retrieve the txt file I type in the prog name in the txtbox and click open file, but i'd like to use a inputbox instead of having to use that. I would appreciate any help with it.
Title: Re: Using Inputbox to retrieve Data saved in a .tx
Post by: Noodlez on January 25, 2003, 05:40 PM
Private Sub mnuOpen_Click()
Dim PrgName As String
Dim Username As String
Dim Passwrd As String
Dim FileName as String
FileName = InputBox("Please enter the path to the file to open","Open File",App.Path & "\Data\")
Open (FileName) For Input As #1
Input #1, strblank
Input #1, PrgName
txtProg.Text = PrgName
Input #1, strblank
Input #1, Username
txtUsername.Text = Username
Input #1, strblank
Input #1, Passwrd
txtPW.Text = Passwrd
 
End Sub
Title: Re: Using Inputbox to retrieve Data saved in a .tx
Post by: Crypticflare on January 26, 2003, 04:05 AM
Wow, I never thought of that, thanks a lot Noodlez