PDA

Click to See Complete Forum and Search --> : Passwords


Insane Killa
Nov 28th, 1999, 04:42 AM
Can Someone Please Tell Me How To Password Protect A Program You Make By Using A Text Box?

Thanx

Bob Baddeley
Nov 28th, 1999, 05:26 AM
for a static (unchanging) password, simply test the text box.

If Text1.Text = "Password" Then
It's all good.
Else
End, get out of the program, whatever.
End If

If you want a dynamic (user-defined) one, then you probably want to make a separate file. You can open that file and put in the user defined password and use that open file to test the password.

Text1.Text = real password
Text2.Text = what user types in

Open "c:\something.txt" for Random as #1
Password = Text1.Text
Put #1,1,Password
Close #1

(that puts the password in the file)

Open "C:\something.txt" for Random as #1
Get #1,1,Password
If Text2.Text = Password Then
La dee da, it's all good.
Else
Get out of here
End If

(that checks the password)

I'm not sure if this is perfect because I haven't checked it, but it should work. Tweak it however you need.

Good luck,
bob