Author |
Message |
JayLo
|
Posted: 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). |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Wed Jan 29, 2003 8:35 pm Post subject: ok |
|
|
this is a very simple one.
code: |
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. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
Vicous
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Mon Mar 03, 2003 12:22 am Post subject: (No subject) |
|
|
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
So its a good idea to encript the files and password protect the program that decrypts them. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
JayLo
|
Posted: Sun Mar 16, 2003 7:01 pm Post subject: hey... |
|
|
what about covering up the password with stars? |
|
|
|
|
![](images/spacer.gif) |
Asok
![](http://www.battle.net/war3/images/neutral/units/animations/pandarenbrewmaster.gif)
|
Posted: Sun Mar 16, 2003 7:09 pm Post subject: (No 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. |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Mar 16, 2003 7:23 pm Post subject: (No subject) |
|
|
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 * |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
JayLo
|
Posted: Sun Mar 16, 2003 9:18 pm Post subject: what if... |
|
|
what if it's in a GUI text Field? |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Mar 16, 2003 9:47 pm Post subject: (No subject) |
|
|
still get input using getch, but instead of outputing on screen, write *s in textbox. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
azndragon
|
Posted: Sun Mar 16, 2003 9:51 pm Post subject: (No subject) |
|
|
yeah, so have it like:
code: | 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 |
|
|
|
|
![](images/spacer.gif) |
|