0

I've got a .txt file with lots of passwords in, in the following format:

(passwords must be between 12-15 characters)

password1
password2
password3


i want to use a text box that allows the user to enter a password & upon the correct password being entered they are allowed to proceed to the next form.

something like this, i would guess:

Dim sr as StreamReader = File.OpenText("C:\test.txt")   
Dim password as string


if  PasswordTextBox = 'a value inside the text file'

then 'proceed to next screen'

else 'password incorrect'

Thanks

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by NewUserVB.Net
0
Private FileName AsString
Dim sr As StreamReader

Function MyParseFunc(ByVal strFileName AsString)

Try

FileName = strFileName

sr = New StreamReader(FileName) 'using streamreader to read the opened text file

Dim strHTml AsString = sr.ReadToEnd

Dim userinput AsString = variable_passed


Dim strStop AsString = "#end#" 'put this at the end of the file so it marks it as the end of file.
Do

Select case strHtml
  Case strHtml = LTime
 'Do something here
  Case strHtml = CTime
'Do something here
LoopWhile strHTml <> strStop

Catch es As Exception

MessageBox.Show(es.Message)

Finally

If Not (sr IsNothing) Then

sr.Close()

EndIf

EndTry

End Function
0

thanks but this shows up so many errors. is there anything i need to import?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.