找回密码
 加入
搜索
查看: 2951|回复: 4

[系统综合] 自动登陆 帮看看那写错了

[复制链接]
发表于 2010-6-10 16:04:19 | 显示全部楼层 |阅读模式
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=f:\新建文件夹\新建文件夹 (2)\自动登陆.kxf
$Form1_1 = GUICreate("自动登陆", 211, 145, 427, 223)
$Label1 = GUICtrlCreateLabel("用户名:", 16, 24, 52, 17)
$Label2 = GUICtrlCreateLabel("密码:", 16, 64, 40, 17)
$Administrator = GUICtrlCreateInput("Administrator", 72, 24, 121, 21)
GUICtrlCreateInput("", 72, 64, 121, 21)
$Button1 = GUICtrlCreateButton("设置自动登陆", 16, 104, 83, 25)
$Button2 = GUICtrlCreateButton("取消自动登陆", 112, 104, 83, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                        Case $nMsg = $Button23
                        GUISetState(@SW_SHOW, $WinSub1)
                        While 1
                                $nMsg = GUIGetMsg()
                                Switch $nMsg
                                        Case $GUI_EVENT_CLOSE
                                                Exit
                                        Case $Button002
                                                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", 0)
                                                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", "")
                                                MsgBox(0, "已取消自动登陆,重启计算机生效", 2)
                                        Case $Button001
                                                $username = GUICtrlRead($Input001)
                                                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", 1)
                                                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", $username)
                                                $password = GUICtrlRead($Input002)
                                                RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", $password)
                                                MsgBox(0, "设置成功,重启计算机生效", 2)
                                                ExitLoop
                                EndSwitch
                        WEnd
                Case $nMs

        EndSwitch
WEnd
发表于 2010-6-10 18:42:09 | 显示全部楼层
#include <ButtonConstants.au3>#include <EditConstants.au3>#include <GUIConstantsEx.au3>#include <StaticConstants.au3>#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=f:\新建文件夹\新建文件夹 (2)\自动登陆.kxf$Form1_1 = GUICreate("自动登陆", 211, 145, 427, 223)$Label1 = GUICtrlCreateLabel("用户名:", 16, 24, 52, 17)$Label2 = GUICtrlCreateLabel("密码:", 16, 64, 40, 17)$input001 = GUICtrlCreateInput("Administrator", 72, 24, 121, 21)$input002=GUICtrlCreateInput("", 72, 64, 121, 21)$Button1 = GUICtrlCreateButton("设置自动登陆", 16, 104, 83, 25)$Button2 = GUICtrlCreateButton("取消自动登陆", 112, 104, 83, 25)GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###While 1&#160; &#160; &#160; &#160; $nMsg = GUIGetMsg()&#160; &#160; &#160; &#160; Switch $nMsg&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Case $GUI_EVENT_CLOSE&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Exit&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Case $nMsg = $Button23&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; GUISetState(@SW_SHOW, $WinSub1)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; While 1&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $nMsg = GUIGetMsg()&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Switch $nMsg&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Case $GUI_EVENT_CLOSE&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Exit&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Case $Button002&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", 0)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", "")&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; MsgBox(0, "已取消自动登陆,重启计算机生效", 2)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Case $Button001&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $username = GUICtrlRead($Input001)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", 1)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", $username)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; $password = GUICtrlRead($Input002)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", $password)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; MsgBox(0, "设置成功,重启计算机生效", 2)&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; ExitLoop&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; EndSwitch&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; WEnd&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Case $nMs&#160; &#160; &#160; &#160; EndSwitchWEnd
手机打的…累
发表于 2010-6-10 19:29:36 | 显示全部楼层
二楼手机档很强啊
发表于 2010-6-11 15:51:44 | 显示全部楼层
写的什么鬼东西啊
发表于 2010-6-11 19:57:07 | 显示全部楼层
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-20 18:21 , Processed in 0.077286 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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