#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $hGUI = GUICreate("Буквенный генератор паролей",700,500)
GUICtrlCreateLabel("Набор символов", 10, 0)
Local $idtext = GUICtrlCreateInput("ABC", 10, 50, 300, 20)
Local $idComboBox = GUICtrlCreateCombo("Выбери символ", 350, 50, 185, 20)
GUICtrlSetData($idComboBox, "Выбери символ")
Local $smb = ""
for $i = Asc("a") to Asc("z")
$Letter = Chr($i)
$smb &=$Letter & "|"
next
GUICtrlSetData($idComboBox, $smb)
GUICtrlCreateLabel("Сгенерированный пароль", 10, 100)
Local $idpassword= GUICtrlCreateInput("", 10, 150, 300, 20)
GUICtrlCreateLabel("Количество символов в пароле", 10, 200)
Local $idlen= GUICtrlCreateInput("20", 210, 200, 90, 20)
Local $idButton= GUICtrlCreateButton("Сгенерировать пароль", 10, 250, 185, 25)
GUISetState(@SW_SHOW, $hGUI)
While 1
$msg = GUIGetMsg()
if $msg = $GUI_EVENT_CLOSE then
ExitLoop
endif
if $msg = $idComboBox Then
Local $smb = ""
for $i = Asc("a") to Asc(GUICtrlRead($idComboBox))
$Letter = Chr($i)
$smb &=$Letter
next
GUICtrlSetData($idtext,$smb)
EndIf
if $msg = $idButton then
Local $password = ""
for $i = 1 to GUICtrlRead($idlen)
$Letter = Chr(Random(Asc("a"), Asc(GUICtrlRead($idComboBox)), 1))
$password &=$Letter
next
GUICtrlSetData($idpassword,"")
GUICtrlSetData($idpassword,$password)
endif
WEnd
|