ahjkcfout7
Знающий
- Сообщения
- 26
- Репутация
- 6
AutoIt: 3.3.8.1
Версия:
Категория: Элементы GUI,
Описание: Генератор паролей
Код/Пример:
Файл: http://
Снимок:
История версий:
Источник: autoit-script.ru
Автор(ы):
Версия:
Категория: Элементы GUI,
Описание: Генератор паролей
Код/Пример:
Код:
#include <GuiRichEdit.au3>
#include <String.au3>
#include <Color.au3>
#include <file.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <Misc.au3>
#Include <Array.au3>
#include <UpdownConstants.au3>
#Include <APIConstants.au3>
#Include <WinAPIEx.au3>
#include <StaticConstants.au3>
HotKeySet("^q", "_Ctrl_Q")
Global $Lenght,$lenght1,$Chars,$Result,$Chars,$Result,$iRand,$Splited,$Paused,$_rus_alphabet,$_eng_alphabet,$_number,$_other,$rus_alphabet_,$eng_alphabet_,$number_,$other_
$rus_alphabet_="АБВГДЕЖЗИЙКЛМНОПРСТУХФЦЧШЩЬЪЭЫЮЯабвгдежзийклмнопрстухфцчшщьъэыюя"
$eng_alphabet_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
$number_="1234567890"
$other_='!@#$%^&*()_+-=""./\|{}[]<>;,:~`'&"''"
$Win = GUICreate("", 635, 250, 350, 180, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), $WS_EX_DLGMODALFRAME)
_WinAPI_SetClassLongEx($Win, $GCL_HICONSM, 0)
_WinAPI_SetClassLongEx($Win, $GCL_HICON, 0)
GUICtrlCreateLabel("password length", 5, 29, 1.8*50)
$Pass_Len = GUICtrlCreateInput (1000, 1.5*60+3, 30-2, 50, 17, 0x2000)
$rus_alphabet= GUICtrlCreateCheckbox ("rus",170, 25)
$eng_alphabet= GUICtrlCreateCheckbox ("eng",220, 25)
$number= GUICtrlCreateCheckbox ("number",270, 25)
$other= GUICtrlCreateCheckbox ("other",335, 25)
GUICtrlSetLimit($Pass_Len, 4)
$reset = GUICtrlCreateButton("Reset", 400, 22, 1.4*50)
$button41 = GUICtrlCreateButton("Generate", 15*30-8+35, 30-8, 1.4*50)
$but_copy = GUICtrlCreateButton("Copy to clip", 15*30-8+44+1.4*50, 30-8, 1.4*50)
$Pass_Use_Symbol = GUICtrlCreateEdit ("",3, 57, 617, 142, 0x0040)
GUISetState(@SW_SHOW, $win)
While True
Global $msg = GUIGetMsg()
If $msg = -3 Then Exit
If $msg = $rus_alphabet Then
If GUICtrlRead($rus_alphabet) = $GUI_UNCHECKED Then $_rus_alphabet=""
If GUICtrlRead($rus_alphabet) = $GUI_CHECKED Then $_rus_alphabet=$rus_alphabet_
GUICtrlSetData($Pass_Use_Symbol,$_rus_alphabet&$_eng_alphabet&$_number&$_other)
EndIf
If $msg = $eng_alphabet Then
If GUICtrlRead($eng_alphabet) = $GUI_UNCHECKED Then $_eng_alphabet=""
If GUICtrlRead($eng_alphabet) = $GUI_CHECKED Then $_eng_alphabet=$eng_alphabet_
GUICtrlSetData($Pass_Use_Symbol,$_rus_alphabet&$_eng_alphabet&$_number&$_other)
EndIf
If $msg = $number Then
If GUICtrlRead($number) = $GUI_UNCHECKED Then $_number=""
If GUICtrlRead($number) = $GUI_CHECKED Then $_number=$number_
GUICtrlSetData($Pass_Use_Symbol,$_rus_alphabet&$_eng_alphabet&$_number&$_other)
EndIf
if $msg = $other Then
If GUICtrlRead($other) = $GUI_UNCHECKED Then $_other=""
If GUICtrlRead($other) = $GUI_CHECKED Then $_other=$other_
GUICtrlSetData($Pass_Use_Symbol,$_rus_alphabet&$_eng_alphabet&$_number&$_other)
Endif
If $msg = $button41 Then RandPassGen()
If $msg = $reset Then
$_rus_alphabet=$rus_alphabet_
$_eng_alphabet=$eng_alphabet_
$_number=$number_
$_other=$other_
GUICtrlSetData($Pass_Use_Symbol,"")
GUICtrlSetState($rus_alphabet, $GUI_UNCHECKED)
GUICtrlSetState($eng_alphabet, $GUI_UNCHECKED)
GUICtrlSetState($number, $GUI_UNCHECKED)
GUICtrlSetState($other, $GUI_UNCHECKED)
EndIf
If $msg = $but_copy Then ClipPut($Result)
Sleep(10)
WEnd
Func RandPassGen()
$Lenght = GUICtrlRead($Pass_Len)
$lenght1 = StringIsInt($Lenght)
$Chars = GUICtrlRead($Pass_Use_Symbol)
If $lenght1 = 1 And $Lenght <= 9999 And $Lenght > 0 Then
$sChars = StringStripWS ($Chars, 8)
$Splited = StringSplit($sChars, "")
for $i = 1 to $Lenght
$iRand = Random(1,UBound($Splited) - 1, 1)
$Result &= $Splited[$iRand]
Next
GUICtrlSetData($Pass_Use_Symbol, $Result)
EndIf
GUICtrlSetData($Pass_Use_Symbol, $Result)
EndFunc
Func _Ctrl_Q()
Exit 0
EndFunc
Файл: http://
Снимок:
История версий:
Источник: autoit-script.ru
Автор(ы):