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

Recommended Answers

All 3 Replies

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

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

I think, that you have to import System.IO, for StreamReader

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.