Jump to content

How to Run a Passwordcheck before open the GUI?


Recommended Posts

This looks nice,

now how can i make it work like?

 

#include <MsgBoxConstants.au3>

Example()

Func Example()

    Local $sPasswd = InputBox("Security Check", "Enter your password.", "", "*")   ;;;; if the password is 1234

   if $sPasswd= "1234"                                                                                                       ;;;;check if pw is 1234
      MsgBox(1,"work","",0)

elseif

exit
   EndFunc   ;==>Example

 

Link to comment
Share on other sites

Where is the problem?

Get the password with Inputbox or whatever

Check the password and then Run your script.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $sPasswd = InputBox("Security Check", "Enter your password.", "", "*")
    If Not @error Then
        If $sPasswd == "1234" Then
            Run("notepad.exe")
        Else
            Exit
        EndIf
    EndIf
EndFunc   ;==>Example

Here is your fish 🙂

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

2 minutes ago, Xenobiologist said:

#include <MsgBoxConstants.au3> Example() Func Example() Local $sPasswd = InputBox("Security Check", "Enter your password.", "", "*") If Not @error Then If $sPasswd == "1234" Then Run("notepad.exe") Else Exit EndIf EndIf EndFunc ;==>Example

Coud iT be love?

 

Thanks Xenobiologist

Link to comment
Share on other sites

Try this:

Everytime you change the password and hit enter, the counter goes +1. After 3 attempts the script exits.

#include <MsgBoxConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $THE_PASSWORD = '1234'

main()

Func main()
    GUICreate("", 196, 29, @DesktopWidth / 2 - 96, @DesktopHeight / 2 - 62, $WS_POPUP)
    GUICtrlSetDefBkColor(0xFF0000)
    GUISetBkColor(0xFF0000)
    GUICtrlCreateLabel("Passwort", 8, 8, 47, 17)
    GUICtrlSetColor(-1, 0xFFFFFF)
    Local $password_I = GUICtrlCreateInput("", 64, 4, 121, 21, $SS_NOTIFY)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUISetState(@SW_SHOW)

    Local $counter = 0

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
            Case $password_I

                If GUICtrlRead($password_I) == $THE_PASSWORD Then
                    Run("notepad.exe")
                    ; your stuff
                Else
                    $counter += 1
                EndIf
                If $counter = 3 Then
                    MsgBox(16, 'ERROR', 'Shame on you!', 5)
                    Exit
                EndIf
        EndSwitch
    WEnd
EndFunc   ;==>main

 

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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...