Jump to content

Recommended Posts

Guest Beefteck
Posted

Hey guys! Just making a little program for my brother and I was hoping at the start of the program I can have a little password enter window.

Here is the code I want to edit:

$passwd = InputBox("Security Check", "Enter your password.", "" , "*")

Simple code. That I am going to put at the begining of the script I have. How would I make it need a password and if the password is wrong, to send an error message with it closing.? Any help would be great.

Thanks so much Autoit Members!!! ;)

-Beefteck

Posted (edited)

$password = "Password to check for here"
$input = InputBox("Security Check", "Enter your password.", "", "*")

If $input <> $password Then
    MsgBox(0, "Error", "Incorrect password. Press OK to exit.")
    Exit
EndIf

Toss that at the start of your script.

Edit: Added the message box you were wanting.

Edited by mikehunt114
IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Guest Beefteck
Posted

nice this is what i needed, thanks for the help mikehunt114

-Beefteck

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...