Board logo

标题: [求助]定时关闭和重新拨号。 [打印本页]

作者: mfdcxnf     时间: 2010-3-25 11:43    标题: [求助]定时关闭和重新拨号。

WScript.CreateObject("WScript.Shell").Run "iexplore http://reg.qq.com/"
WScript.Sleep 2000
Set Sh = CreateObject("WScript.Shell")
Sh.SendKeys "QQ"
Sh.SendKeys "{Tab}"
Sh.SendKeys "2008"
Sh.SendKeys "{Tab}"
Sh.SendKeys "8"
Sh.SendKeys "{Tab}"
Sh.SendKeys "8"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "aaaa"    '密码
Sh.SendKeys "{Tab}"
Sh.SendKeys "aaaaa"    '密码
Sh.SendKeys "{Tab}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{Tab}"
Sh.SendKeys "{down}"
Sh.SendKeys "{down}"
Sh.SendKeys "{Tab}"

这是一个申请QQ的VBS,我在想如果加上一段自动断开和重新连接网络的代码就完美了。
断网

VBS Set ObjShell=CreateObject("Wscript.Shell")
VBS SttCommand=("cmd.exe /C rasdial /d")
VBS ObjShell.Run SttCommand, 0, False
连接

VBS Set ObjShell=CreateObject("Wscript.Shell")
VBS SttCommand=("cmd.exe /C rasdial 连接名称 连接帐号 连接密码")
VBS ObjShell.Run SttCommand, 0, False

举例
VBS SttCommand=("cmd.exe /C rasdial 宽带连接 0551788888 cs245872")
最上面的运行三次以后才能再运行下面的代码,如果申请一个变量是否可以得到,请大家帮忙。
作者: mfdcxnf     时间: 2010-3-25 11:45    标题: 补充

即当三次申请QQ后,就重新断开和启动网络的操作,然后这个超作需要延时。能否同时完成