|
6#
楼主 |
发表于 2010-3-28 11:26:16
|
只看该作者
呵呵,刚起来上网看有没有回复咯,下面是从一堆test function 里面摘出来的。麻烦帮忙看看。谢谢
'****************************************
'直接关闭所有IE进程
'****************************************
Public function CloseAllBrowsers
SystemUtil.CloseProcessByName "iexplore.exe"
End Function
'*************************************************************
'打开网页地址
'************************************************************
Function OpenUrl( url )
Dim StartURL,IE
StartURL = url
set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
IE.Navigate StartURL
End Function
'*************************************************************
'创建对象
'************************************************************
Function createObj(ProName,ProValue)
Dim obj
Execute "Set obj = Description.Create()"
'msgbox "obj(" & Quote(ProName) & ").value = " & Quote(ProValue)
Execute "obj(" & Quote(ProName) & ").value = " & Quote(ProValue)
set createObj = obj
End Function
'*************************************************************
'Quote 函数的作用是在变量 txt 两端 加上双引号
'************************************************************
Public Function Quote (txt)
Quote = chr(34) & txt & chr(34)
End Function
'*************************************************************
'setObjectProperty 给对象设置属性
'************************************************************
Function setObjectProperty ( ObjName , ProName , ProValue )
'msgbox ObjName & "(" & Quote(ProName) & ").value = " & Quote(ProValue)
ExecuteGlobal ObjName & "(" & Quote(ProName) & ").value = " & Quote(ProValue)
End Function
'*************************************************************
'调用过程
'************************************************************
CloseAllBrowsers
TargetURL = "www.360buy.com"
OpenUrl TargetURL
set baseBrowser = createObj ("micclass","Browser")
'createObj(ProName, ProValue)
set basePage = createObj( "micclass","Page")
set baseLink = createObj ("micclass","Link")
setObjectProperty "baseLink","name","电脑整机" |
|