- 帖子
- 156
- 积分
- 178
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2021-6-19
|
46楼
发表于 2023-6-19 20:36
| 只看该作者
师傅 你好 忘记密码了 怎样修改 谢谢
#NoTrayIcon
#Persistent
SendMode Input
SetWorkingDir, C:\Users\Public\Documents ;密码文件目录
If !FileExist(".password") {
SetPassword()
}
SetTimer, BlockWindow, 500
Return
BlockWindow:
if WinExist("ahk_class CabinetWClass",,,"地址: I:") and WinExist("ahk_class CabinetWClass",,,"地址: R:") {
WinClose
Gui, Destroy
WinClose
If !FileExist(".password") {
SetPassword()
}
Gui, Add, Text, w250 h30, 请输入密码 只验证一次:
Gui, Add, Edit, Password w230 vPassword
Gui, Add, Button, Default w100 h50 gCheckPassword, 确定
Gui, Add, Button, w100 h50 gButtonChangePassword, 修改密码
Gui, Show, w250 h200
Return
}
SetPassword()
{
InputBox, input_password, 设置密码, 请设置密码
FileDelete, .password
FileAppend, %input_password%, .password
FileSetAttrib, +H, .password
}
Return
ChangePassword()
{
FileReadLine, stored_password, .password, 1
InputBox, current_password, 修改密码, 请输入当前密码
if (current_password = stored_password) {
InputBox, new_password, 修改密码, 请输入新密码
FileDelete, .password
FileAppend, %new_password%, .password
FileSetAttrib, +H, .password
MsgBox,, 密码修改成功
} else {
MsgBox,, 当前密码错误
}
}
Return
CheckPassword:
Gui, Submit
FileReadLine, stored_password, .password, 1
if (password = stored_password) {
Run, explorer.exe ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
ExitApp
} else {
MsgBox,, 密码错误
}
Return
ButtonChangePassword:
ChangePassword()
Return |
|