#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form = GUICreate("正则提取密码 By lynfr8", 259, 76, 192, 124)
$Input = GUICtrlCreateInput("54173", 24, 24, 137, 21)
$Button = GUICtrlCreateButton("密码", 176, 24, 57, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
$user = StringRegExp(FileRead('user.txt'),'登陆的帐号:(\d+), 密码:(\d+)',3)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
$userExists = ''
For $i= 0 to UBound($user) - 1 Step 2
If $user[$i]=GUICtrlRead($Input) And $userExists <> $user[$i+1] Then
MsgBox('','',$user[$i+1])
$userExists = $user[$i+1]
EndIf
Next
EndSwitch
WEnd
|