感谢大家。
本来是来学习的,看过上面内容之后,很有启发,就写了下面的。。。
- Private Sub SleepA()
- WScript.Sleep 100 '根据情况适当修改延迟时间
- End Sub
- Private Sub ADSL(ISP,UserName,PassWord)
- Dim WshShell
- set WshShell=WScript.CreateObject("WScript.Shell")
- Dim strCommandLine
- strCommandLine="rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,4"
- With WshShell
- .Run strCommandLine
- SleepA
- .AppActivate "Internet 属性"
- .SendKeys "%U"
- SleepA
- .SendKeys "{Enter}"
- SleepA
- .AppActivate "新建连接向导"
- SleepA
- .SendKeys "{Enter}"
- SleepA
- .SendKeys "%C"
- SleepA
- .SendKeys "{Enter}"
- SleepA
- .SendKeys "%M"
- SleepA
- .SendKeys "{Enter}"
- SleepA
- .SendKeys "%U"
- SleepA
- .SendKeys "{Enter}"
- SleepA
- .SendKeys ISP
- SleepA
- .SendKeys "{Enter}"
- SleepA
- .SendKeys UserName
- SleepA
- .SendKeys "{Tab}"
- SleepA
- .SendKeys PassWord
- SleepA
- .SendKeys "{Tab}"
- SleepA
- .SendKeys PassWord
- SleepA
- .SendKeys "{Enter}"
- SleepA
- .SendKeys "%S"
- SleepA
- .SendKeys "{Enter}"
- End With
- Set WshShell=Nothing
- End Sub
- Private Sub CreateNetwork()
- Dim ISP,User,Pass
- ISP=InputBox("请输入宽带连接名称(汉字不行哟):","创建新连接","vbs")
- User=InputBox ("请输入用户名:","创建新连接")
- Pass=InputBox ("请输入密码:","创建新连接")
- Call ADSL(ISP,User,Pass)
- End Sub
- Call CreateNetwork
复制代码
|