Click to See Complete Forum and Search --> : Passwords
n1s
Nov 13th, 1999, 02:58 AM
Does Anyone Have A Code For VB 3.0 so that when you go into it it asks for a password in an input box????
rino_2
Nov 13th, 1999, 02:39 PM
When you go into what???
MendyGreen
Dec 26th, 2004, 10:52 PM
If you mean 'go into program' then the code is here,
visual basic code:
Sub Form1_OnLoad()
Dim Password
Password=Inputbox("Enter password to continue.","Password")
Do Until Password="hi"
MsgBox"Wrong! Please try again.",48,"Password"
Password=Inputbox("Enter password to continue.","Password")
Loop
MsgBox"Correct!",64,"Password"
End Sub
The 'Form1' is the name of the form, the password that is set is: 'hi' you can change that by the 'Do until password="hi"' the only problem with that is when you type the password in, theres no way that I know of to make it show up as stars. Well hope that helped
dglienna
Dec 26th, 2004, 11:10 PM
if you use a textbox for the input, you can use a mask for stars. Just place a "*" in PasswordChar.
dis1411
Dec 27th, 2004, 01:38 AM
i'd advise against looping until the password is correct unless you allow the user to exit the loop by pressing cancel
dglienna
Dec 27th, 2004, 01:45 AM
I had a management password in my old app, that I'm re-writing. I haven't decided whether or not to implement one in this version. I hard-coded the last one, and don't want to in this version. Does anybody hard code a master password into their programs? I've known mainframes that have dual-passwords for everything, as well as passwords that never change. I just wonder how everybody else does it?
David.Poundall
Dec 27th, 2004, 04:28 AM
Used to hard code them, then I came up with a routine that works needing a new password every day. It was linked to the name of the user and the date (of course). Problem was, I had to fire up a second program to calculate the password of the day when I was on site.
That used to be an annoyance so I ended up hard coding a 20 digit password based on the first character of each of the words of an obscure nursery rhyme I learned (and never forgot) as a kid.
Works like a charm, and I defy anyone looking over my shoulder to copy it when I am on site.
Moral of the story - A system can have as fancy a password as you like but I will bet there is always a back door.
.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.