=> topic: password...
hi dear thinbasic friends
have done a new password example and what a surprise I have one more question about this example ...
first of all here the password console script !!!
[code=thinbasic]'-------- password try by lionheart 08.april2009
'-------- new version at 28.april2009
Uses "Console", "UI","File"
Dim InputUser, InputUser1 As String
Dim StringBuffer As String
Dim StringBuffer1 As String
dim trialPassword as string = "Lionheart"
dim lColor as long
dim Hiddenpassword as string = "Franko Lionheart"
printl
printl "-..enter your first password for LIONBASIC-Module than type ENTER.. -"
printl
'---Loop and collect entered chars till user press ENTER key
Do
sleep 10
InputUser = Console_InKeyB()
Select Case Len(InputUser)
Case 1
print "# "
StringBuffer += inputUser
Case 2
if right$(InputUser, 1) = chr$(13) then exit do
Case 3
if left$(InputUser, -1) = chr$(9) then exit do
End Select
Loop
'---Now check password and output results
printl
if StringBuffer = trialPassword then
'---Color green highlighted
lColor = Console_ForegroundRGB(0,1,0,1)
Console_SetTextAttribute(lColor)
printl
printl "Perfect! you have got the right password."
else
'---Color red highlighted
lColor = Console_ForegroundRGB(1,0,0,1)
Console_SetTextAttribute(lColor)
printl
printl " I'm sorry, password is not correct, generate new one "
printl
printl " You have failed just entered: " & StringBuffer
printl " so your open Trial Password for 30 days is: " & trialpassword
printl
printl " Hidden password for LIONBASIC Module Fullversion is: " '& hiddenpassword
printl " Send now your new password by e-mail: " ' & hiddenpassword
end if
'---Color yellow highlighted
lColor = Console_ForegroundRGB(1,0,1,1)
Console_SetTextAttribute(lColor)
File_save("hidden.txt", hiddenpassword)
'---Finish
printl
printl "--- Thanks for trying LIONBASIC Module. Press any key to next task ---"
sleep 50
printl
waitkey
'------------------------
TYPE UserAccount
Username as String * 16
UserPassword as string * 16
END TYPE
dim u as UserAccount
DIM f, i, found as integer
DIM usr, usr1, pwd, yesno as string
usr = "Lionbasic"
usr1 = "Fantomas"
console_cls
printl
printl "-- do you want create a new log-in account [yes/no] ", YesNo
printl
sleep 50
'---Color yellow highlighted
lColor = Console_ForegroundRGB(1,1,0,1)
Console_SetTextAttribute(lColor)
printl "Hey, try a new log-in account with password ..."
printl
printl "-- type in something new exciting stuff --"
Do
sleep 10
'IF UCASE$(YN) = "Y" Then
InputUser1 = Console_InKeyB()
Select Case Len(InputUser1)
Case 1
print " * "
StringBuffer1 += inputUser1
Case 2
if right$(InputUser1, 1) = chr$(13) then exit do
Case 3
if left$(InputUser, -1) = chr$(9) then exit do
end select
sleep 10
'End if
Loop
printl
if StringBuffer1 = usr then
lColor = Console_ForegroundRGB(0,1,0,1)
Console_SetTextAttribute(lColor)
printl
printl "Great! You have got now the Second right Password."
else
lColor = Console_ForegroundRGB(1,0,0,1)
Console_SetTextAttribute(lColor)
printl
printl " I'm sorry, NEW password is not correct."
printl
printl " You have entered for NEW Account: " & StringBuffer1
printl
printl " so... you have got NEW Loginpassword for 30 days Trialperiode : " & usr
end if
printl
lColor = Console_ForegroundRGB(0,0,0,1)
Console_SetTextAttribute(lColor)
printl
printl "Great! You have got now the Second right Password."
printl "all is ok, your new account was created..."
printl
printl "... have sent your correct password by e-mail again "
printl
File_save("hidden2.txt", usr1)
printl "- push any key and exit script -"
waitkey[/code]
this script works nearly perfect
next task: I would like to interrogate such a callback with "YES / NO" callbacks.. I will see
servus, have all a nice day, Lionheartprintl "-- do you want create a new log-in account [yes/no] ", YesNo
Bookmarks