This was made using the dll's found here:
http://forum.thegamecreators.com/?m=forum_view&t=46148&b=6
This is a beta version. I'll try to make a more advanced password protection that encrypts it more later on.
REM Project: Password (beta)
REM Created: 1/21/2005 8:49:39 PM
REM
REM Author is Death Stalker
REM
REM Dll's from Marsh TOD
REM
REM ***** Main Source File *****
REM
rem Disable all of the keys so that you can't find the file
cls
disable escapekey
disable systemkeys
load dll "WinLockDll.dll", 1
call dll 1, "CtrlAltDel_Enable_Disable" ,0 `disables control-alt-delete
call dll 1, "AltTab2_Enable_Disable" ,0,0 `disables alt-tab
call dll 1, "Keys_Enable_Disable" ,0 `disables system keys
call dll 1, "TaskSwitching_Enable_Disable" ,0 `disables alt-tab task switching
rem Check if the file exists
`if exists then go to 'load'
`otherwise make password
start:
if file exist ("C:\WINDOWS\winRegistration_Num.ini")=1 then goTo: load else goTo: create
rem Create the password
create:
cls
input "Please type in your password consisting of numbers > ",pass$
`Encrypts ONLY the numbers into the ASCII character for those numbers
writPass$ = chr$(val(pass$))
`opens the file to get written and hides it with a plausible name in the Windows directory
open to write 1,"C:\WINDOWS\winRegistration_Num.ini"
`writes the character
write string 1,writPass$
`closes the file
close file 1
goTo: theThing
rem Starts the password-checking sequence
load:
`the variable for the number of times you can try for the password
tries = 1
do
`opens the file for reading
open to read 2,"C:\WINDOWS\winRegistration_Num.ini"
`reads the string
read string 2,passEncrypt$
`closes it
close file 2
cls
input "Please enter your numerical password to procede > ",daPassa$
`turns the numbers you entered into a number to check the password
daPassb# = val(daPassa$)
`turns the letter from the file back into it's number
realPass# = asc(passEncrypt$)
`checks if you have the right password
if realPass# = daPassb# then goTo: delete
`if wrong, adds 1 to the number of tries you have
tries = tries + 1
if tries = 10 then goTo: passInvalid
loop
rem Gives you the choice of deleting your account
delete:
cls
input "Do you wish to delete this account and create a new one? (Y/N) > ",choIce$
`if yes, then deletes your file
if left$(choIce$,1)="n" or left$(choIce$,1)="N" then: goTo: theThing
delete file "C:\WINDOWS\winRegistration_Num.ini"
`starts over
goTo: start
rem What happens if you have the wrong password
passInvalid:
cls
`Re-enables the dll's and other keys
call dll 1, "Keys_Enable_Disable" ,1
call dll 1, "CtrlAltDel_Enable_Disable" ,1
call dll 1, "AltTab2_Enable_Disable" ,0,1
call dll 1, "TaskSwitching_Enable_Disable" ,1
enable escapekey
enable systemkeys
do
center text screen width()/2,screen height()/2,"Sorry, but you have tried too many invalid passwords."
center text screen width()/2,screen height()/2+25," Press 'esc' to quit."
loop
rem This is where your program goes
theThing:
cls
`Re-enables the dll's and other keys
enable escapekey
enable systemkeys
call dll 1, "Keys_Enable_Disable" ,1
call dll 1, "CtrlAltDel_Enable_Disable" ,1
call dll 1, "AltTab2_Enable_Disable" ,0,1
call dll 1, "TaskSwitching_Enable_Disable" ,1
print "It works if this works"
wait key
rem If you have any questions, post it on the thread this came from
rem Or post if you find bugs
rem Or if you have ideas for improvments
rem **note**this is a basic version
www.war3forums.net