Teen Programmers Unite  
 

 

Return to forum top

Password

Posted by Dev [send private reply] at September 25, 2001, 01:54:47 AM

I;m creating a PC Lock thingy and when you boot it you type in a password, it then goes to another form where the only way to exit is by typing in the password you typed in before. There is also an ability to change the password. I've tried using modules and heaps of other things but the 2nd form won't recognize the password you type in at the start. Any help would be greatly appreciated. The language i'm using is VB and i've got version 4.0
Thanx
Dev

Posted by gian [send private reply] at September 25, 2001, 02:03:02 AM

You are using VB 4...
* Gian Smirks Knowingly
If you were doing it in C, you could do some funky boot sector stuff, and lock the whole computer if it doesn't work!

Posted by Dev [send private reply] at September 25, 2001, 02:04:16 AM

I'm gonna get version 6.0 in about a week.
But thats the end of the school holidays:(

Posted by Psion [send private reply] at September 25, 2001, 02:24:47 PM

I would presume it's impossible to do what you want to do in VB.

Posted by gian [send private reply] at September 25, 2001, 04:25:51 PM

I'm sorry, I didn't make myself clear... it should have been:
"You're using VB... 4".
My assumption would be like Psions.

Posted by taubz [send private reply] at September 25, 2001, 05:12:41 PM

What you said is a very vague description of the problem... what isn't working that is causing it to not recognize the password? Are you setting the password in a global variable? Is it not there when you go to check the password on the 2nd form?

How does your program work (or not work) - from the programming side of things, not how is it used?

- taubz

Posted by grandsnafu [send private reply] at September 25, 2001, 08:47:53 PM

I'm not so sure I understand what's going on, but why can't you do something like (haven't done VB for a while) :

[somewhere on form 1, maybe in login's click or something)
dim password as string

password = text1.text ' text1 is where the dude's typing his password

[somewhere on form 2]
' text2 is the text on form 2 where the guy types his password
if text2.text = password
'logout or something
end if

you could also try
[somewhere on form 2]
if text2.text = form1.text1.text
'fancy logout stuff here, again
end if

Of course, this is all assuming that I understood what you were asking, which I'm not sure happened. Good luck. If you want to know more, post here because email doesn't work all that well.

NOTICE OF APOLOGY : I apologize to the entire TPU community for posting Visual Basic code to this board. Hopefully no one will be *too* offended by this and I will continue to be allowed to post. Maybe not, though.

Posted by grandsnafu [send private reply] at September 25, 2001, 08:48:52 PM

Oh, and don't forget (as taubz said) to dim password as global.

Posted by taubz [send private reply] at September 25, 2001, 09:50:03 PM

Yeah, for clarification, the "dim password" *must not* be in the click event, otherwise it will be a local variable (Dev: having no meaning outside of that subroutine). It must be defined in a module using the Public keyword (so that the variable is public to all forms, modules, etc) - or it has to be defined in the (General)|(Declarations) section of a form, also using the Public keyword.

Dev, this is probably your problem. I recommend going into options and turning on Require Variable Declaration, or in General/Declarations typing Option Explicit at the top. That catches a lot of mistakes.

- taubz

Posted by gian [send private reply] at September 25, 2001, 11:15:08 PM

Because you have apologised, I will name you "Most respectable TPUer" for today, and most of tommorow.
* Gian places the cardboard crown on grandsnafu.

Posted by Psion [send private reply] at September 26, 2001, 06:13:09 AM

My point was that I doubt you can create a VB program that doesn't just allow the user to "ctrl-alt-delete" his way around your "password protection".

Posted by buzgub [send private reply] at September 26, 2001, 08:46:13 AM

There is a windows API call which stops ctrl+alt+del, alt+F4 and all those from working; I've found some info on it at http://www.vbtt.com/articles/windows_95_screensaver_secrets.html

"There are some extra details, for instance in Win95 we disable Ctrl-Alt-Del by calling SystemParametersInfo with the SPI_SCREENSAVERRUNNING flag if a screensaver password is enabled, while Windows NT handles that chore itself (being much more security-conscious in general than Win95). "

So, that can be looked up in the API viewer thingy and disabled. http://abstractvb.com/code.asp?CID=41 will help Dev ditch the start menu, and http://www.vbsquare.com/api/hideshell-demo/ ought to help Dev hide the desktop icons.

Posted by taubz [send private reply] at September 26, 2001, 05:25:07 PM

Psion, buzgob, I don't think that's how Dev wants to do this.... I'm trying to help him write *his* program, not a true security thing.

Also... WinNT won't allow CTRL+ALT+Del to be hooked at all.

- taubz

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.