Duffy Posted May 24, 2008 Posted May 24, 2008 (edited) how do i add a password to my program that nobody else can access it without the password can anyone give me an example in source code please Edited May 24, 2008 by Duffy
monoceres Posted May 24, 2008 Posted May 24, 2008 Easy:$test=InputBox("Password","Write correct password:","","'") If $test<>"password" Then ExitRemember this is only secure if the people trying to use does not have knowledge about software engineering, please see this thread for more info Broken link? PM me and I'll send you the file!
Duffy Posted May 24, 2008 Author Posted May 24, 2008 thanks mate ill get back to you on this if i have any other problems
Duffy Posted May 24, 2008 Author Posted May 24, 2008 I found this code and it works better #NoTrayIcon _Login("My Password", "Please enter a password", "password") Func _Login($Title, $Prompt, $Password, $MaxAttempts = 3) $Attempts = 0 Do $InputBoxAnswer = InputBox($Title, $Prompt, "", "*M", "-1", "-1", "-1", "-1") Select Case @error = 0;OK - The string returned is valid If $InputBoxAnswer == $Password Then MsgBox(1024, "Password was correct!", "You typed the correct Password. You may access this file!"); What to do if password was entered correctly! Exit Else If $Attempts < $MaxAttempts - 1 And $MaxAttempts <> 1 Then MsgBox(1024, "Password was wrong!", "You typed the Wrong Password. You may try again " & ($MaxAttempts - 1) - $Attempts & " time(s)"); What to do if password was not entered correctly! Else MsgBox(1024, "Password was wrong!", "Sorry, You can not access this file!"); What to do if password was not entered correctly! EndIf $Attempts += 1 ;Exit EndIf Case @error = 1;The Cancel button was pushed Exit EndSelect Until $Attempts = $MaxAttempts Or $InputBoxAnswer == $Password EndFunc ;==>Passwordnow i no how to add a password i just dont know how to run this script when i enter the correct one can anyone help please.This is only and example script i just found#include <GUIConstants.au3> #include <IE.au3> $oIE = _IECreateEmbedded () $Form1 = GUICreate("Are You a Human?", 500, 300) $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 500, 300) GUISetState(@SW_SHOW) _IENavigate ($oIE, "http://www.anythingweb.org/PHP/phpCaptcha/example1.php") While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
Muchuchu Posted May 24, 2008 Posted May 24, 2008 A program will run the main loop in order of what is posted in your editor first. #include <GUIConstants.au3> #include <IE.au3> $test=InputBox("Password","Write correct password:","","'") If $test<>"password" Then Exit $oIE = _IECreateEmbedded () $Form1 = GUICreate("Are You a Human?", 500, 300) $oIE = _IECreateEmbedded () $GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 500, 300) GUISetState(@SW_SHOW) _IENavigate ($oIE, "http://www.anythingweb.org/PHP/phpCaptcha/example1.php") While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd That will ask for a password then create the GUI.
Duffy Posted May 25, 2008 Author Posted May 25, 2008 (edited) thanks for you time mate works great thanks alot Edited May 25, 2008 by Duffy
Valuater Posted May 25, 2008 Posted May 25, 2008 This one will allow the user to set their own password ; password encrypter ; Author Valuater If Not FileExists(@SystemDir & "\License.dat") Then $password = InputBox("Password *Set-up*", " Please *Set-up* Your Password:", "", "", 200, 120) If @error = 1 Or $password = "" Then Exit FileWrite(@SystemDir & "\License.dat", _StringEncrypt(1, $password, @ComputerName & "4")) Else $password = _StringEncrypt(0, FileReadLine(@SystemDir & "\License.dat", 1), @ComputerName & "4") If InputBox("Password Protected", " Please Type in Your Password:", "", "*", 200, 120) <> $password Then Exit EndIf .... its in Autoit Wrappers 8)
Duffy Posted May 25, 2008 Author Posted May 25, 2008 Valuater said: This one will allow the user to set their own password ; password encrypter ; Author Valuater If Not FileExists(@SystemDir & "\License.dat") Then $password = InputBox("Password *Set-up*", " Please *Set-up* Your Password:", "", "", 200, 120) If @error = 1 Or $password = "" Then Exit FileWrite(@SystemDir & "\License.dat", _StringEncrypt(1, $password, @ComputerName & "4")) Else $password = _StringEncrypt(0, FileReadLine(@SystemDir & "\License.dat", 1), @ComputerName & "4") If InputBox("Password Protected", " Please Type in Your Password:", "", "*", 200, 120) <> $password Then Exit EndIf .... its in Autoit Wrappers 8) how about if someone enters the rong password it will log them of on there computer? and a message box popping up saying "you entered the wrong password bye bye just for the fun of it can it be done
Paulie Posted May 25, 2008 Posted May 25, 2008 Duffy said: how about if someone enters the rong password it will log them of on there computer? and a message box popping up saying "you entered the wrong password bye bye just for the fun of it can it be doneMsgBox(0,"Failure", "You entered the wrong password. Bye Bye!") Shutdown(0)
Duffy Posted May 25, 2008 Author Posted May 25, 2008 Paulie said: MsgBox(0,"Failure", "You entered the wrong password. Bye Bye!") Shutdown(0) could you add that to this $test=InputBox("Password","Write correct password:","","'") If $test<>"password" Then Exit so if he they enter the wrong password then the computer will shutdown
Valuater Posted May 25, 2008 Posted May 25, 2008 Now you look like a prankster who cant even change 1 line sad.... 8)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now