av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

Ruby關(guān)閉IE進(jìn)程采用直接關(guān)閉進(jìn)程法

在Ruby語言的實(shí)際是代碼編寫中,我們會(huì)覺得它的編寫方式不同于其他語言,并且在編寫代碼時(shí)會(huì)有一種非常愉悅的心情。在這里我們就為大家介紹一下Ruby關(guān)閉IE進(jìn)程的相關(guān)方法。#t#

使用watir的close_all方法,有時(shí)會(huì)關(guān)閉不掉IE,***的Ruby關(guān)閉IE進(jìn)程辦法就是直接終止IE進(jìn)程,可以寫一個(gè)關(guān)閉ie的方法

  1. require 'win32ole'  
  2. # Returns the number 
    of windows
     processes running with
     the specified name.  
  3. def close_ie  
  4. mgmt = WIN32OLE.connect
    ('winmgmts:\\\\.')  
  5. processes=mgmt.
    instancesof("win32_process")  
  6. processes.each do |process|  
  7. puts process  
  8. if process.name ==
    "iexplore.exe" then   
  9. process.terminate()  
  10. end  
  11. end  
  12. end  

這樣調(diào)用close_ie方法時(shí)就可以實(shí)現(xiàn)Ruby關(guān)閉IE進(jìn)程了。


當(dāng)前文章:Ruby關(guān)閉IE進(jìn)程采用直接關(guān)閉進(jìn)程法
當(dāng)前鏈接:http://uogjgqi.cn/article/djcciic.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們在微信上24小時(shí)期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流