Computer Science Canada

password and window

Author:  JayLo [ Wed Jan 29, 2003 7:21 pm ]
Post subject:  password and window

I would like to create a password window. When you first run the program it will go to the password screen and ask for the password. If the password is correct then it will go to the main window (my translating program, thank you tony).

Author:  Dan [ Wed Jan 29, 2003 8:35 pm ]
Post subject:  ok

this is a very simple one.


var pass:string %var for input
var goodpass:string:="swat" %the real pass

%main loop
put "put in pass: "..
get pass %get input

if pass = goodpass then %check input
put "loading...."
put ""
exit %exit loop
end if

put "bad pass"
put ""
end loop

put code in fornt of the part that needs a pass.
chage good pass to the password.

Author:  Vicous [ Mon Mar 03, 2003 12:14 am ]
Post subject:  password

also, there is a code (look up exec in the turing help screens) that allows you to execute other programs, so try making an 'if then' statement that if they get the right password, it starts the normal program, but this isn't as secure

Author:  Tony [ Mon Mar 03, 2003 12:22 am ]
Post subject: 

that what they do with those textbook CDs... Confused Basically you can directly access files with Adobe Reader instead of loading reader from the program thats password protected Wink

So its a good idea to encript the files and password protect the program that decrypts them.

Author:  JayLo [ Sun Mar 16, 2003 7:01 pm ]
Post subject:  hey...

what about covering up the password with stars?

Author:  Asok [ Sun Mar 16, 2003 7:09 pm ]
Post subject: 

well it would need to get the password in the background and then for each character put a * in. This can be done in a getch loop. The tricky part of it is backspacing. I know there is a keyboard command for backspace I just don't know it off the top of my head.

Author:  Tony [ Sun Mar 16, 2003 7:23 pm ]
Post subject: 

i remember writing the password program, I just cant find it at the moment Confused

ASCII value of backspace is 8

in a loop, you run untill enter is pressed (ASCII 10 i belive). When you backspace, then you check that current password entered is more then 0 and if so, just cut the last character. Then using locate put a blank space instead of *

Author:  JayLo [ Sun Mar 16, 2003 9:18 pm ]
Post subject:  what if...

what if it's in a GUI text Field?

Author:  Tony [ Sun Mar 16, 2003 9:47 pm ]
Post subject: 

still get input using getch, but instead of outputing on screen, write *s in textbox.

Author:  azndragon [ Sun Mar 16, 2003 9:51 pm ]
Post subject: 

yeah, so have it like:

for i : 1.. length(word)
put "*" .. %makes all text on one line
end for
put "" %Ends the single line string

And then it will display a * for every letter in the password. If you want it to use getch, then just have it display the * character, and have it loop until some sort of 'exit' key is pressed.

Mod Edit: Azndragon is awarded 8 bits - Asok