本帖最后由 lixiaolong 于 2010-12-26 18:06 编辑
回复 1# ybbihsse
一个例子:
#include <GUIConstantsEx.au3>
GUICreate(" GUI 接收文件的输入控件", 320, 120)
$yonghu = GUICtrlCreateInput("", 60, 5, 240, 20)
GUICtrlCreateLabel("用户名:", 10, 10)
$mima = GUICtrlCreateInput("", 60, 35, 240, 20)
GUICtrlCreateLabel(" 密码:", 10, 35)
$btn = GUICtrlCreateButton("确定", 240, 75, 60, 20)
GUICtrlSetState($btn, $GUI_DEFBUTTON)
$yonghuming = "lixiaolong"
$pass = "pass"
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $btn
If GUICtrlRead($yonghu) == $yonghuming And GUICtrlRead($mima) == $pass Then
MsgBox(0, "", "您输对了!")
Else
MsgBox(0, "", "您输入的用户名或者密码不对!请输入正确的用户名或者密码!")
GUICtrlSetData($yonghu, "")
GUICtrlSetData($mima, "")
EndIf
EndSelect
WEnd
隐藏密码:
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
GUICreate(" GUI 接收文件的输入控件", 320, 120)
$yonghu = GUICtrlCreateInput("", 60, 5, 240, 20)
GUICtrlCreateLabel("用户名:", 10, 10)
$mima = GUICtrlCreateInput("", 60, 35, 240, 20, $ES_PASSWORD)
GUICtrlCreateLabel(" 密码:", 10, 40)
$btn = GUICtrlCreateButton("确定", 240, 75, 60, 20)
GUICtrlSetState($btn, $GUI_DEFBUTTON)
$yonghuming = "lixiaolong"
$pass = "pass"
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $btn
If GUICtrlRead($yonghu) == $yonghuming And GUICtrlRead($mima) == $pass Then
MsgBox(0, "", "您输对了!")
Else
MsgBox(0, "", "您输入的用户名或者密码不对!请输入正确的用户名或者密码!")
GUICtrlSetData($yonghu, "")
GUICtrlSetData($mima, "")
EndIf
EndSelect
WEnd
|