Donald8274 Posted December 2, 2009 Share Posted December 2, 2009 Hello, I need help with getting a password from an ini file I don't completely understand how to do it. my code... $password1 = IniRead($username3 &".ini", $username3, "Password", ) I don't know what to put in the last part for it to check to see if it is the right password. Any help would be appreciated. Link to comment Share on other sites More sharing options...
JohnOne Posted December 3, 2009 Share Posted December 3, 2009 (edited) The last optional parameter is a default value to return if an ini value is not found. If thats not what you mean then you just have to check it against your password If $password1 = "yourpassword" Then Msgbox(0,"YAY!!","Correct"} Else Msgbox(0,"BOOOOO!!","Incorrect") EndIf Exit Edited December 3, 2009 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Donald8274 Posted December 3, 2009 Author Share Posted December 3, 2009 (edited) I mean to check it against my own password so that way it checks to see if they are the same. For example... $password = inputbox("Password", "Please type in the password you wish to use.") IniWrite("Account.ini", "Account", "Password", $password) $passwordbox = inputbox("Password", "Please input the password") If $passwordbox = ??? then msgbox(0, "Yay", "Correct") else msgbox(0, "Aww", "Incorrect") endif I don't know how to get the password from the ini file like that. Edited December 3, 2009 by Donald8274 Link to comment Share on other sites More sharing options...
JohnOne Posted December 3, 2009 Share Posted December 3, 2009 (edited) Possibly $password = inputbox("Password", "Please type in the password you wish to use.") IniWrite("Account.ini", "Account", "Password", $password) $passwordcheck = IniRead("Account.ini", "Account", "Password" ) $passwordbox = inputbox("Password", "Please input the password") If $passwordbox = $passwordcheck then msgbox(0, "Yay", "Correct") else msgbox(0, "Aww", "Incorrect") endif EDIT: sorry try it again Edited December 3, 2009 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Donald8274 Posted December 3, 2009 Author Share Posted December 3, 2009 I have tried that but it keeps saying that the variable is not defined. Link to comment Share on other sites More sharing options...
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