TA的每日心情 | 难过 2015-9-21 13:50 |
---|
签到天数: 4 天 连续签到: 1 天 [LV.2]测试排长
|
5#
楼主 |
发表于 2009-5-19 14:12:55
|
只看该作者
这个其实也是方法重载的一个例子;
下面我做了个详细的,把set和close方法进行了重载。
============================================================================
SystemUtil.CloseProcessByName("iexplore.exe")
SystemUtil.Run "iexplore.exe","www.baidu.com",,,3
Set Bro = description.Create()
Bro("title").value = ".*"
Set Pag = description.Create()
pag("title").value = ".*"
Set webedit1 = description.Create()
webedit1("name").value = ".*"
Function MySet(obj,x)
MySet=obj.set(x)
msgbox "Myset"
End Function
Function Myclose(obj)
MyClose=obj.close
msgbox"Myclose"
End Function
RegisterUserFunc "WebEdit","Set","MySet"
Browser(Bro).Page(Pag).WebEdit(WebEdit1).Set "你好"
UnRegisterUserFunc "WebEdit","Set"
RegisterUserFunc "Browser","Close","Myclose"
Browser(Bro).Close
UnRegisterUserFunc "Browser","Close"
============================================================================
[ 本帖最后由 fei.ge 于 2009-5-19 14:24 编辑 ] |
|