
-----------------------------------
JayLo
Wed Jan 29, 2003 7:21 pm

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).

-----------------------------------
Dan
Wed Jan 29, 2003 8:35 pm

ok
-----------------------------------
this is a very simple one.


var pass:string %var for input
var goodpass:string:="swat" %the real pass

%main loop
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.

-----------------------------------
Vicous
Mon Mar 03, 2003 12:14 am

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

-----------------------------------
Tony
Mon Mar 03, 2003 12:22 am


-----------------------------------
that what they do with those textbook CDs... :? 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.

-----------------------------------
JayLo
Sun Mar 16, 2003 7:01 pm

hey...
-----------------------------------
what about covering up the password with stars?

-----------------------------------
Asok
Sun Mar 16, 2003 7:09 pm


-----------------------------------
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.

-----------------------------------
Tony
Sun Mar 16, 2003 7:23 pm


-----------------------------------
i remember writing the password program, I just cant find it at the moment :?

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 *

-----------------------------------
JayLo
Sun Mar 16, 2003 9:18 pm

what if...
-----------------------------------
what if it's in a GUI text Field?

-----------------------------------
Tony
Sun Mar 16, 2003 9:47 pm


-----------------------------------
still get input using getch, but instead of outputing on screen, write *s in textbox.

-----------------------------------
azndragon
Sun Mar 16, 2003 9:51 pm


-----------------------------------
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
