Posted: Fri Nov 21, 2003 8:37 pm Post subject: password
i want to make a program so that if you enter a password word right it goes to the desktop or something but if the password is wrong then the computer shuts down.some help would be great thanks.
[/code]
Sponsor Sponsor
Tony
Posted: Fri Nov 21, 2003 8:43 pm Post subject: (No subject)
you'd have to use Sys.Exec
to shutdown, just execute shutdown.exe. It is located somewhere in Windows folder. I think
As for going to desktop, you can execute a shortcut, pointing to the desktop.
Posted: Fri Nov 21, 2003 8:45 pm Post subject: (No subject)
i think he wanted it as a security thing like locking up the comp
Mazer
Posted: Fri Nov 21, 2003 10:47 pm Post subject: (No subject)
that's a pretty cool idea. but you have to make sure the user doesn't just ignore the window to avoid having the computer shut down. check this out:
code:
var win : int := Window.Open ("graphics:600;400")
loop
% do your get the password stuff here
if Window.GetActive = -1 then % the turing run window isn't selected
% do your shutdown stuff here, because they are trying to avoid entering the password!
end if
delay (150)
cls
end loop
and it works! if they click outside the run window, (or do anything that would cause the run window to no longer be the active window) you'll know about it. meaning: no ctrl+alt+del and end task on the turing program. gee, that's pretty evil....
EDIT:
oh yeah, when the user enters the correct password, have
code:
Window.Close (win)
return %<- just in case you are in a loop or something, that'll exit the program completely
Andy
Posted: Sun Nov 23, 2003 3:39 pm Post subject: (No subject)
nooo... nick you still have to end the program using return...
Mazer
Posted: Sun Nov 23, 2003 10:59 pm Post subject: (No subject)
dodge_tomahawk wrote:
nooo... nick you still have to end the program using return...
did that make any sense at all to you?
scorpion1087
Posted: Tue Nov 25, 2003 6:04 pm Post subject: (No subject)
Thanks for the code but i cant find the path for shutdown!
Andy
Posted: Tue Nov 25, 2003 6:58 pm Post subject: (No subject)
i meant, if you just close the window, the program doesnt shut down... you have to close the window, and then stop the program with the return command
Sponsor Sponsor
Mazer
Posted: Tue Nov 25, 2003 9:26 pm Post subject: (No subject)
but i did use return. check the edit... in fact, this time i'm pretty sure i actually added the edit before someone noticed the mistake. but anyways, while incorrectly reading your post, i noticed something... you can just click on the X and close the run window... that'd make all this other stuff pretty useless.
EDIT: oh... is that what you meant? if the user closes the window? that's one of those things that bug me about turing.
code:
var win : int := Window.Open ("graphics:600;400")
var mx, my, btn : int
loop
mousewhere (mx, my, btn)
% do your get the password stuff here
if Window.GetActive = -1 or my > maxy then % the turing run window isn't selected
% do your shutdown stuff here, because they are trying to avoid entering the password!
end if
delay (50)
cls
end loop
i added the or my > maxy part in case the user tries to click X. but upon further cotemplation, i think this would be one of those times when it's somewhat useful to switch back to turing 3.1 in order to use it's fullscreen capability. that way the user can't click X and you don't need to worry about using mousewhere (i mean, what if the mouse starts up higher than the top of the window... that'd kinda suck). plus, it probably looks cooler to have a fullscreen window open than to have some stupid turing window. real spiffy. but i'm not sure if Window.GetActive works in turing 3.1 and i don't have a copy of it to check myself.
but anyways...
code:
Sys.Exec ("c:/windows/system32/shutdown.exe")
i believe that's what you were looking for?
Andy
Posted: Tue Nov 25, 2003 9:33 pm Post subject: (No subject)
actually nick, you can just make the exe uncolseable... turing has that option... and sry, i didnt see that part of your code
Mazer
Posted: Tue Nov 25, 2003 9:39 pm Post subject: (No subject)
dodge_tomahawk wrote:
actually nick, you can just make the exe uncolseable... turing has that option... and sry, i didnt see that part of your code
ah yes... that's right.
Andy
Posted: Tue Nov 25, 2003 9:40 pm Post subject: (No subject)
ya, do this in turing 3, everything is the same, except editor and minor commands like view.update
scorpion1087
Posted: Wed Nov 26, 2003 5:31 pm Post subject: (No subject)
hey thanks to all, my program is a A O K now!!!!!!!!!!
Andy
Posted: Wed Nov 26, 2003 6:32 pm Post subject: (No subject)
too bad the samething cant work on our comps at school... stupid security
thoughtful
Posted: Wed Nov 26, 2003 6:40 pm Post subject: (No subject)
LOL, I hate the securtiy, not only does it mindle with the educational stuff, it also doesnt let us Download important stuff like shockwave player to play games. But we keep pissing the teachers off by downloading pocket tanks on the student drive. (thats the only game those computers can run without hanging up)