• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ruby学习系列--操作htmlfile对象

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
1 require 'win32ole'
2 
3    a = WIN32OLE.new('htmlfile')
4    methods = a.ole_methods.select { |m| m.visible? }
5    methods.each do |meth|
6        puts "#{meth.name}(" +meth.params.map {|p| "#{p.ole_type} #{p.name}" }.join(''+ ")"
7    end
8 

 

 

输出内容如下:

>ruby 本文件.rb
all()
body()
activeElement()
images()
applets()
links()
forms()
anchors()
title()
title()
scripts()
selection()
readyState()
frames()
embeds()
plugins()
alinkColor()
alinkColor()
bgColor()
bgColor()
fgColor()
fgColor()
linkColor()
linkColor()
vlinkColor()
vlinkColor()
referrer()
location()
lastModified()
url()
url()
domain()
domain()
cookie()
cookie()
defaultCharset()
defaultCharset()
mimeType()
fileSize()
fileCreatedDate()
fileModifiedDate()
fileUpdatedDate()
security()
protocol()
nameProp()
write(VARIANT psarray)
writeln(VARIANT psarray)
open(BSTR url, VARIANT name, VARIANT features, VARIANT replace)
close()
clear()
queryCommandSupported(BSTR cmdID)
queryCommandEnabled(BSTR cmdID)
queryCommandState(BSTR cmdID)
queryCommandIndeterm(BSTR cmdID)
queryCommandText(BSTR cmdID)
queryCommandValue(BSTR cmdID)
execCommand(BSTR cmdID, BOOL showUI, VARIANT value)
execCommandShowHelp(BSTR cmdID)
createElement(BSTR eTag)
onhelp()
onhelp()
onclick()
onclick()
ondblclick()
ondblclick()
onkeyup()
onkeyup()
onkeydown()
onkeydown()
onkeypress()
onkeypress()
onmouseup()
onmouseup()
onmousedown()
onmousedown()
onmousemove()
onmousemove()
onmouseout()
onmouseout()
onmouseover()
onmouseover()
onreadystatechange()
onreadystatechange()
onafterupdate()
onafterupdate()
onrowexit()
onrowexit()
onrowenter()
onrowenter()
ondragstart()
ondragstart()
onselectstart()
onselectstart()
elementFromPoint(I4 x, I4 y)
parentWindow()
styleSheets()
onbeforeupdate()
onbeforeupdate()
onerrorupdate()
onerrorupdate()
toString()
createStyleSheet(BSTR bstrHref, I4 lIndex)
releaseCapture()
recalc(BOOL fForce)
createTextNode(BSTR text)
documentElement()
attachEvent(BSTR event, DISPATCH pdisp)
detachEvent(BSTR event, DISPATCH pdisp)
onrowsdelete()
onrowsdelete()
onrowsinserted()
onrowsinserted()
oncellchange()
oncellchange()
ondatasetchanged()
ondatasetchanged()
ondataavailable()
ondataavailable()
ondatasetcomplete()
ondatasetcomplete()
onpropertychange()
onpropertychange()
dir()
dir()
oncontextmenu()
oncontextmenu()
onstop()
onstop()
createDocumentFragment()
onbeforeeditfocus()
onbeforeeditfocus()
getElementsByName(BSTR v)
getElementById(BSTR v)
getElementsByTagName(BSTR v)
focus()
hasFocus()
onselectionchange()
onselectionchange()
namespaces()
createDocumentFromUrl(BSTR bstrUrl, BSTR bstrOptions)
media()
media()
CreateEventObject(VARIANT pvarEventObject)
FireEvent(BSTR bstrEventName, VARIANT pvarEventObject)
createRenderStyle(BSTR v)
oncontrolselect()
oncontrolselect()
URLUnencoded()
onmousewheel()
onmousewheel()
doctype()
implementation()
createAttribute(BSTR bstrattrName)
createComment(BSTR bstrdata)
onfocusin()
onfocusin()
onfocusout()
onfocusout()
onactivate()
onactivate()
ondeactivate()
ondeactivate()
onbeforeactivate()
onbeforeactivate()
onbeforedeactivate()
onbeforedeactivate()
compatMode()
nodeType()
parentNode()
hasChildNodes()
childNodes()
attributes()
insertBefore(IHTMLDOMNode newChild, VARIANT refChild)
removeChild(IHTMLDOMNode oldChild)
replaceChild(IHTMLDOMNode newChild, IHTMLDOMNode oldChild)
cloneNode(BOOL fDeep)
removeNode(BOOL fDeep)
swapNode(IHTMLDOMNode otherNode)
replaceNode(IHTMLDOMNode replacement)
appendChild(IHTMLDOMNode newChild)
nodeName()
nodeValue()
nodeValue()
firstChild()
lastChild()
previousSibling()
nextSibling()
ownerDocument()
>Exit code: 0


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Rubychar=ASCII发布时间:2022-07-14
下一篇:
ruby2.2.2源代码阅读笔记发布时间:2022-07-14
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap