Jump to content

Passworded Program?


Swift
 Share

Recommended Posts

how would i create a password protected program...and you need the password to start the program basically...a input box...but you must type a password or it wont go on...wait...i belive there is a example script of this...so delete this if i find it...but....thanks for the help...and also a password to terminate/close a program.

EDIT: cool...i got the program to ask for a password...but how would i request a password to terminate the program?

Edited by Swift
Link to comment
Share on other sites

how would i create a password protected program...and you need the password to start the program basically...a input box...but you must type a password or it wont go on...wait...i belive there is a example script of this...so delete this if i find it...but....thanks for the help...and also a password to terminate/close a program.

EDIT: cool...i got the program to ask for a password...but how would i request a password to terminate the program?

Detect when the program close is selected (maybe $GUI_EVENT_CLOSE) and then ask for a password. If wrong then don't exit.

If you want to be sure you would have to register the WM_CLOSE message I expect and respond to that because someone could close the program through the task manager.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Toy around with this

#include <GUIConstants.au3>

$Password = "Password"
Do
    $pass = InputBox("Password Required", "Please Input Your Password.", "", "*")
    If $pass == $Password Then
        MsgBox(0,"Correct", "Password Correct.")
    Else
        MsgBox(0,"Invalid", "Password Invalid. Try Again.")
    EndIf
Until $Pass == $Password
;;---Your Program below:
$GUI =GUICreate("Your Program window", 200,300)
GUICtrlCreateLabel("Press the X to Close", 50,135)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            $pass = InputBox("Password Required", "Please Input Your Password.", "", "*")
            If $pass = $Password Then
                MsgBox(0,"Correct", "Password Correct. Exiting...")
                Exit
            Else
                MsgBox(0,"Invalid", "Password Invalid. Continuing...")
            EndIf
    EndSwitch
WEnd
Link to comment
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
 Share

  • Recently Browsing   0 members

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