Ruby 在 IE 中打开对话框

2015-01-19 0 944
Ruby 在 IE 中打开对话框
require "win32ole"

def ieInputBox( msg, default )
  ie = WIN32OLE.new("InternetExplorer.Application");
  ie.visible  = false
  sleep 0.01 while (ie.busy)

  script = ie.Document.Script;
  result = script.prompt(msg,default);
  ie.quit

  result
end

result = ieInputBox( "Please enter your name",
                     "Dave Bowman")

if result
  puts result
else
  puts "User pressed Cancel"
end

遇见资源网 ruby Ruby 在 IE 中打开对话框 http://www.ox520.com/16226.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务