|
Public Function Log_in(ip,user,pw)
Dim oShell
Set oShell = CreateObject ("WSCript.shell")
oShell.run ip
Set oShell = Nothing
wait (2)
If Dialog("nativeclass:=#32770","index:=0").exist(1) Then
Dialog("nativeclass:=#32770","index:=0").WinEdit("nativeclass:=edit","index:=1").set user
Dialog("nativeclass:=#32770","index:=0").WinEdit("nativeclass:=edit","index:=2").set pw
Dialog("nativeclass:=#32770","index:=0").WinButton("nativeclass:=Button","index:=0").click
End If
End Function
这个是远程登陆的代码片,要用的话,Log_in "\\192.168.1.1","admin","admin"
里面只做到了简单捕获对话框Dialog而已,如果有具体情况,还需要大家把这个片断去完善。
因为MSN群里的热心朋友问到这个问题,而采用的是sendkeys的方法,个人不推荐使用这个,所以写写普及下。 |
|