Ruby: 获取IE的一些信息(其实应用AutoIt脚本本身,获取这些信息更加简单)

require'win32/registry'

hkey_local_machine=Win32::Registry::HKEY_LOCAL_MACHINE

defgetKeyValue(hive, key_path, key_name)

              reg_obj=hive.open(key_path, Win32::Registry::KEY_READ)

              begin

                      reg_typ, reg_val = reg_obj.read(key_name)

              rescue Win32::Registry::Error

                      puts "key not found : #{key_name}"

              end

              return reg_val

end

defGetIEBrowserVersion()

              hkey_local_machine=Win32::Registry::HKEY_LOCAL_MACHINE

              return getKeyValue(hkey_local_machine, "SOFTWARE\Microsoft\InternetExplorer", "Version")

            end

 

k=GetIEBrowserVersion()

puts 'IE version:'+k

原文地址:https://www.cnblogs.com/autotest/p/3262445.html