|
新手学习,所以写得比较差,望大家不要笑哦。
问题1:复选框勾上以后,任何一个按钮按下,执行完代码后自动关闭程序自身。反之不勾则不关闭。(具体不知道怎么写那段代码和值,望高手解答)
问题2:第一个和第二个按钮其实执行的代码是一样的,但只是变量不同。我想问一下可不可以改一下代码,只写一段执行代码,然后两个按钮都可以执行,只是变量是INI里分别指定的。
#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=D:\autoit3\Aut2Exe\Icons\TLB.ico
#AutoIt3Wrapper_outfile=QQ自动登录器.exe
#AutoIt3Wrapper_Res_Comment=QQ自动登录器
#AutoIt3Wrapper_Res_Description=QQ自动登录器
#AutoIt3Wrapper_Res_Fileversion=1.0
#AutoIt3Wrapper_Res_LegalCopyright=Copyright (C) 残风败鳞 2008-2010.All rights reserved.
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$user1 = IniRead("mone.ini","QQ","号码1","")
$user2 = IniRead("mone.ini","QQ","号码2","")
$pwd1 = IniRead("mone.ini","密码","密码1","")
$pwd2 = IniRead("mone.ini","密码","密码2","")
$Form1 = GUICreate("XX专用", 130, 180, 193, 115)
GUISetIcon("D:\Program Files\QQ\QQ.exe")
$Button1 = GUICtrlCreateButton($user1, 24, 10, 81, 33, 0)
$Button2 = GUICtrlCreateButton($user2, 24, 54, 81, 33, 0)
$Button3 = GUICtrlCreateButton("广告位招租", 24, 98, 81, 33, 0)
$Label1 = GUICtrlCreateLabel("作者:残风败鳞", 48, 137, 128, 15)
$Label2 = GUICtrlCreateLabel("QQ:00000000", 54, 152, 128, 15)
$Checkbox1 = GUICtrlCreateCheckbox("自动关闭本程序", 24, 166, 105, 15)
GUICtrlSetFont(-1, 9, 400, 0, "Terminal")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
Run("D:\Program Files\QQ\QQ.exe")
WinActivate("QQ用户登录")
WinWait("QQ用户登录")
ControlClick("QQ用户登录","","Edit1")
ControlSend("QQ用户登录","登录","Edit1",$user1)
ControlClick("QQ用户登录","","Edit12")
Send($pwd1)
send("{enter}")
Case $Button2
Run("D:\Program Files\QQ\QQ.exe")
WinActivate("QQ用户登录")
WinWait("QQ用户登录")
ControlClick("QQ用户登录","","Edit1")
ControlSend("QQ用户登录","登录","Edit1",$user2)
ControlClick("QQ用户登录","","Edit12")
Send($pwd2)
Send("{enter}")
Case $Button3
MsgBox("64","提示","广告位招租 如果需要请联系作者!QQ:00000000")
EndSwitch
WEnd
INI文件内容:
mone.ini
[QQ]
号码1=123456
号码2=456789
[密码]
密码1=1abcd
密码2=1abcd
[说明]
因为QQ版本问题,所以不同版本密码输入会有不同,如果输入的是正确密码
却提示密码不正确,请在密码前面加个1。
[ 本帖最后由 gs008970 于 2008-10-25 17:44 编辑 ] |
|