求教:登陆宽带猫的窗口,如何输入用户名密码
http://www.hostpic.biz/uploads/553635d034.jpg#include<ie.au3>
dim $name1="admin",$pass1="admin",$name2="telecomadmin",$pass2="nE7jA%5m"
$soie=_IECreate("192.168.1.1")
WinActivate("连接到 192.168.1.1","此服务器要求")
if winwait("连接到 192.168.1.1","")Then
ControlSetText("连接到 192.168.1.1","","Edit2",$name1)
ControlSetText("连接到 192.168.1.1","","Edit3",$pass1)
send("enter")
EndIf
Exit
刚学一个星期,请教下各们高手,如何能自动填入用户名和密码呢?
始终等不到这窗口,为什么
[ 本帖最后由 冲盈 于 2008-9-7 12:46 编辑 ] 应该是先等窗口出现才操作的。建议尝试一下:
WinWait("连接到 192.168.1.1", "", 10)
If WinExists("连接到 192.168.1.1") Then
WinActivate("连接到 192.168.1.1")
ControlSetText("连接到 192.168.1.1","","Edit2",$name1)
ControlSetText("连接到 192.168.1.1","","Edit3",$pass1)
Send("{ENTER}")
EndIf Run ( @ProgramFilesDir & "\Internet Explorer\iexplore.exe 192.168.1.1" )
WinWaitActive ( "连接到 192.168.1.1" )
WinActivate( "连接到 192.168.1.1" )
ControlSetText ( "连接到 192.168.1.1", "", "Edit2", "admin" )
ControlSetText ( "连接到 192.168.1.1", "", "Edit3", "admin" )
ControlClick ( "连接到 192.168.1.1", "", "Button2" )
这样写应该没问题吧 谢谢楼上的两位热心兄弟,再次感谢
3楼的代码可以解决,:face (36):
页:
[1]