Jump to content
  1. PCI

    PCI

  • Similar Content

    • By v0id
      I am starting out using AutoIt. Here is a simple form with username and password. I want to check if information entered is valid once user clicks a button.
      My problem now is that it only validates once. E.g.: if I type 5 character username, it will complain it is not 7 character (good). But once I correct that mistake and press the button again it will still say the same thing.
      Do I need to have a loop?
       
      #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <MsgBoxConstants.au3> Opt("GUIOnEventMode", 1) $main = GUICreate("Test Tool", 600, 600) $hyourlabel = GUICtrlCreateLabel("YOUR CREDENTIALS", 30, 10, 256) GUICtrlSetFont($hyourlabel, Default, 600) Local $adminfrejalabel = GUICtrlCreateLabel("Username:", 8, 38, 64, 17) Global $adminfrejaid = GUICtrlCreateInput("", 80, 38, 110, 17) Local $adminpasswordlabel = GUICtrlCreateLabel("Password:", 8, 62, 64, 17) Global $adminpassword = GUICtrlCreateInput("", 80, 62, 110, 17, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) $userButton_Check = GUICtrlCreateButton("VALIDATE", 32, 480, 85, 25) GUICtrlSetOnEvent($userButton_Check, "startvalidation") GUISetOnEvent($GUI_EVENT_CLOSE, "ExitGUI") GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd Func startvalidation() ;CHECK VALIDATIONS $adminfrejaid = GUICtrlRead($adminfrejaid) $adminpassword = GUICtrlRead($adminpassword) If StringLen($adminfrejaid) <> '7' Then MsgBox($MB_SYSTEMMODAL, "User ID", "Please enter exactly 7 characters.") ;Exit EndIf If StringLen($adminpassword) < '5' Then MsgBox($MB_SYSTEMMODAL, "Your Password", "Please enter a valid password.") ;Exit EndIf EndFunc Func ExitGui () Exit ; Exit the program EndFunc  
    • By matwachich
      HI everybody! It's been a (very) long time since I posted something useful!
      Here I come with a new functions that I needed in a project that needs many different forms to insert different data into a database. Instead of creating a different Koda form for each data type, I decided to create this function, inspired by this one (from the excellent IUP GUI library).
      To create an input dialog, you first must create a JSON definition of this dialog. Simple example of a login form:
      { title: "Dialog Title", controls: [ {type:"label", value:"Please login"}, {type:"input", id:"user", label:"User name"}, {type:"input", id:"pass", label:"Password", style:$ES_PASSWORD}, {type:"check", id:"remember", label:"Remember me", value:true} ] } Then pass it to the advInputBox function:
      #include "advInputBox.au3" Dim $oRet = advInputBox($sJSON) If @error Then MsgBox(64, "Example1", "Dialog canceled") Else MsgBox(64, "Example1", "Return: " & Json_Encode($oRet, 128)) ; you can access individual values by ids: ; Json_ObjGet($oRet, "username") ; Json_ObjGet($oRet, "password") ; Json_ObjGet($oRet, "remember") EndIf And you will get an InputBox like this one:

      The code is on GutHub
      Enjoy!
       
    • By JustinZandee
      I need a random string generator which creates 15 letters/numbers.
      How can I make that?
    • By nacerbaaziz
      Hi dears
      How are you?
      I have a question, to you please.
      How do I create an edit box for numbers only and does not accept letters? using autoit
      greetings to all
      I hope you help ME
      Thanks to all in advance
    • By Anas
      Hi,
      I've this script (removed unrelated parts) that generate a set of random chars for a password. It gets launched from a network share by Task Scheduler at a specific time for all PC's, then it relaunches itself from the local drive.
       
      Global $LocalToolsDir = @ProgramFilesDir & '\Tools' Start() Func Start() If Not StringInStr(@ScriptFullPath, $LocalToolsDir, 2) Then Exit RunLocaly() Sleep(Random(1, 1800, 1) * 1000) $NewPass = GeneratePass() EndFunc Func GeneratePass() Local $Pass For $i = 1 to 8 $R = Random(0,1.5) If $R > 1 Then $Chr = Random(0,9,1) ElseIf $R < 0.5 Then $Chr = Chr(Random(Asc("A"), Asc("Z"), 1)) Else $Chr = Chr(Random(Asc("a"), Asc("z"), 1)) Endif $Pass &= $Chr Next Return $Pass EndFunc Func RunLocaly() Local $Run = 1, $LocalApp = $LocalToolsDir & '\' & @ScriptName If Not FileExists($LocalApp) Then $Run = FileCopy(@ScriptFullPath, $LocalToolsDir, 1 + 8) If $Run Then Run($LocalApp, $LocalToolsDir) EndFunc  
      The problem is that many PC's ends up with the same password(s).
      e.g. 10 PC's have (abc123) as a Password, and another 10 have this (def456)
      Any idea why?
×
×
  • Create New...