Ruby 在 IE 中打开对话框

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

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