select line input

KummaZ
04-21-2003, 12:20 AM
ok dumb question.
i have a text file and i have a password on the first line and then the login name on the second.
how do i stick the login name in a variable. (told you it was dumb)

PWNettle
04-21-2003, 12:24 AM
ok dumb question.
i have a text file and i have a password on the first line and then the login name on the second.
how do i stick the login name in a variable. (told you it was dumb)

Open your file in input mode and read in the lines to variables. Something like:

Dim lngFile As Long
Dim strPassword As String
Dim strUsername As String

lngFile = FreeFile

Open "c:\pathto\yourfile.txt" For Input As #lngFile
Line Input #lngFile, strPassword
Line Input #lngFile, strUsername
Close #lngFile

MsgBox "The login name is " & strUsername

Paul

KummaZ
04-21-2003, 12:30 AM
thanks i modified it a bit to work around the encrypted stuff, thanks for that. i can't believe i forgot.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum