Sign in to follow this  
Followers 0
Donald8274

ini password help

5 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Donald8274

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

I have tried that but it keeps saying that the variable is not defined.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0