maoying 发表于 2009-5-17 14:53:20

run和IE类代码能连起来用吗

本帖最后由 maoying 于 2009-5-18 23:59 编辑

写了段代码,想开启TL-WR340G路由的无线功能:
前半部分(用默认的用户名登录):
Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE 192.168.1.1')
WinWait("Connect to 192.168.1.1","")
If Not WinActive("Connect to 192.168.1.1","") Then WinActivate("Connect to 192.168.1.1","")
WinWaitActive("Connect to 192.168.1.1","")
Send("{ENTER}");确认登录,图参见popup.gif:

后半部分:
#include <IE.au3>
$oIE = _IEAttach ("TL-WR340G 54M无线宽带路由器","Title")
$oFrame = _IEFrameGetObjByName ($oIE, "bottomLeftFrame")
_IELinkClickByText ($oFrame, "无线参数")
$oFrame = _IEFrameGetObjByName ($oIE, "mainFrame")
$oForm = _IEFormGetCollection ($oFrame, 0)
_IEFormElementCheckboxSelect ($oForm, 2, "ap", 1, "byValue")        ;开启无线功能
$oQuery = _IEFormElementGetObjByName ($oForm, "Save")
_IEAction($oQuery ,"click")       

分别运行都OK,但貌似合起来后就卡在$oIE那里
请各位指教一下

maoying 发表于 2009-5-17 14:55:41

有空顶顶,有益身心

autothem 发表于 2009-5-17 19:34:48

这样用是没问题的

你检查一下IE的标题是不是“TL-WR340G 54M无线宽带路由器”,默认是必须完全匹配的

maoying 发表于 2009-5-18 20:41:18

对啊,成功了
多谢楼上 :face (36):
页: [1]
查看完整版本: run和IE类代码能连起来用吗