找回密码
 加入
搜索
查看: 3904|回复: 3

[GUI管理] 防止泄漏密码输入界面

[复制链接]
发表于 2012-10-19 21:34:36 | 显示全部楼层 |阅读模式
本帖最后由 gold13 于 2012-10-19 21:47 编辑

防止泄漏密码输入界面功能:可以输入八位数字密码,每次按刷新产生随机数字按键位置,可以防止被泄密。
图形界面如下:

部分代码如下:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("WinTitleMatchMode", 2)
Opt("GUIOnEventMode", 1)
Opt("TrayIconHide", 1)
#Region ### START Koda GUI section ### Form=
$mm_Form1 = GUICreate("防泄密", 170, 213, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "mm_Form1Close")
$Label1 = GUICtrlCreateLabel("请输入密码:", 8, 8, 66, 17)
$Label2 = GUICtrlCreateLabel("刷新键盘", 88, 8, 60, 17)
GUICtrlSetFont(-1, 8, 400, 4, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetOnEvent(-1, "OutRandom")
$PasswordEdit = GUICtrlCreateInput("12345678", 9, 29, 153, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_PASSWORD))
$Number1 = GUICtrlCreateButton("1", 8, 58, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number2 = GUICtrlCreateButton("2", 48, 58, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number3 = GUICtrlCreateButton("3", 88, 58, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number4 = GUICtrlCreateButton("4", 8, 96, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number5 = GUICtrlCreateButton("5", 48, 96, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number6 = GUICtrlCreateButton("6", 88, 96, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number7 = GUICtrlCreateButton("7", 8, 134, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number8 = GUICtrlCreateButton("8", 48, 134, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number9 = GUICtrlCreateButton("9", 88, 134, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$Number0 = GUICtrlCreateButton("0", 8, 172, 36, 36)
GUICtrlSetOnEvent(-1, "main")
$assuredOK1 = GUICtrlCreateButton("确定", 128, 58, 35, 113)
GUICtrlSetOnEvent(-1, "assuredOK1Click")
$clearout1 = GUICtrlCreateButton("清除", 48, 172, 57, 36)
GUICtrlSetOnEvent(-1, "clearout1Click")
$retrieve1 = GUICtrlCreateButton("更正", 107, 172, 56, 36)
GUICtrlSetOnEvent(-1, "retrieve1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        Sleep(100)
WEnd

Func main()
        GUICtrlSetData($PasswordEdit, GUICtrlRead($PasswordEdit) & GUICtrlRead(@GUI_CtrlId))
        If StringLen(GUICtrlRead($PasswordEdit)) <= 9 Then GUICtrlSetData($PasswordEdit, StringLeft(GUICtrlRead($PasswordEdit), 8))
EndFunc   ;==>main
Func assuredOK1Click()
        MsgBox(0, "密码", GUICtrlRead($PasswordEdit))
EndFunc   ;==>assuredOK1Click
Func Clearout1Click()
        GUICtrlSetData($PasswordEdit, "")
EndFunc   ;==>Clearout1Click
Func Retrieve1Click()
        GUICtrlSetData($PasswordEdit, StringLeft(GUICtrlRead($PasswordEdit), StringLen(GUICtrlRead($PasswordEdit)) - 1))
EndFunc   ;==>Retrieve1Click
Func OutRandom();产生随机数字,修改0-9按钮位置        
EndFunc   ;==>OutRandom
Func mm_Form1Close()
        Exit
EndFunc   ;==>mm_Form1Close
源代码和程序见下面。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2012-10-19 21:36:24 | 显示全部楼层
本帖最后由 gold13 于 2012-10-19 21:48 编辑

完整代码如下:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2012-10-20 00:15:10 | 显示全部楼层
这里下载东西贵的很~
发表于 2012-10-20 08:44:10 | 显示全部楼层
谢谢分享!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-18 13:33 , Processed in 0.074665 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表