05-12-2003, 05:49 PM
Hey everyone,
This might be a more advanced question but I have made a password script which uses windows for getting access and than i just made a plain registration script.
The problem I need solving is that once the right password is entered that they can start the registration!
My scripts runs like this: I enter the correct password and than use the goto code but windows wont switch to dos.
Password code:
Registration code:
This might be a more advanced question but I have made a password script which uses windows for getting access and than i just made a plain registration script.
The problem I need solving is that once the right password is entered that they can start the registration!
My scripts runs like this: I enter the correct password and than use the goto code but windows wont switch to dos.
Password code:
Code:
nomainwin
enter$ = chr$(_VK_RETURN) : backspace$ = chr$(_VK_BACK)
bs = 2 '
WindowWidth = 285 : WindowHeight= 130
'center the window
UpperLeftX = (DisplayWidth-WindowWidth)/2
UpperLeftY = (DisplayHeight-WindowHeight)/2
'graphicbox is used to capture key input
graphicbox #pass.gb, 0,0,0,0
textbox #pass.tb, 1,20,275,25
'ok button optional
button #pass.default, "Ok", [ok],UL 100,60,70,25
open "Enter Password" for window as #pass
print #pass, "trapclose [quitpass]"
print #pass, "font courier_new 10 bold"
print #pass.gb, "setfocus"
print #pass.gb, "when characterInput [letter]"
timer 400, [t]
wait
[t]
'if enter = 1 the enter key was pressed
if enter = 1 then timer 0 : goto [ok]
print #pass.gb, "setfocus"
wait
[letter]
timer 0
key$ = Inkey$ : key$ = left$(Inkey$, 2) : vkey$ = right$(key$,1)
if vkey$ <> enter$ and vkey$ <> backspace$ then
b$ = b$ + key$ : b = len(b$) : fill$ = ""
for x = 1 to b:fill$ = fill$ + "*" : next x 'fill mask with "*"
print #pass.tb, fill$ : print #pass.gb, "setfocus"
end if
if vkey$ = enter$ then enter = 1
if vkey$ = backspace$ and bs = 2 then
b = len(b$) : b=b-1 : b$ = left$(b$,b) : fill$ = ""
for x = 1 to b : fill$ = fill$ + "*" : next x 'fill mask with "*"
print #pass.tb, fill$ : print #pass.gb, "setfocus"
bs = bs +1: if bs = 3 then bs = 1 else if bs = 1 then bs = 2
end if : timer 400, [t]
wait
[quitpass]
timer 0
close #pass
end
[ok]
timer 0
if b$ = "hello" then 'password is "ok"
'do events for correct password
notice " " + chr$(13) + "Correct password" : print #pass.tb, ""
print #pass.gb, "setfocus" : b$ = ""
enter = 0 'leave timer off if opening a new window "timer 0"
timer 400, [t]
else
'do events for wrong password
notice " " + chr$(13) + "Wrong Password!" : print #pass.tb, ""
print #pass.gb, "setfocus" : b$ = "" : enter = 0 : timer 400, [t]
end if
wait
Registration code:
Code:
PRINT "Welcome to the registration forms!"
PRINT "Please complete the fields marked with an '*' and the normal fields are optional."
PRINT "Here we go..."
PRINT "Full Name? *"
PRINT "Example: Ely Edgard Daniel Raeds"
INPUT N$
PRINT " "
PRINT "Please choose a password *"
INPUT P$
PRINT " "
PRINT "Please re-enter your password *"
INPUT Q$
PRINT " "
PRINT "Please enter your e-mail address *"
PRINT "Example: yourname@yourdomain.com"
INPUT E$
PRINT " "
PRINT "Please re-enter your e-mail address *"
INPUT R$
PRINT " "
PRINT "Share e-mail address?"
INPUT M$
PRINT " "
PRINT "Your location?"
PRINT "Example: Belgium"
INPUT L$
PRINT " "
PRINT "Your interests?"
INPUT I$
PRINT " "
PRINT " "
PRINT "Thank you for registrating with us. We hope you will have a pleasant stay!"
PRINT " "
PRINT "Disclaimer:"
PRINT "Your e-mail will not be given/sold to any companies/users unless you gave us permission."
url=http://forums.containment-breach.net][/url]