2011-12-17 75 views
1

可能重複:
How can I make my application check if Adobe flash player is installed on a PC?看到用戶是否安裝了Adobe Flash Player?

我需要確保用戶具有當該程序啓動Internet Explorer安裝最新版本的Flash播放器,沒有人知道我怎麼能檢查爲了這?

+0

你到目前爲止試過了什麼? http://www.google.com/#sclient=psy-ab&hl=en&site=&source=hp&q=c%23+check+if+program+is+installed&pbx=1&oq=c%23+check+if+program+is + installed&aq = f&aqi = g1&aql =&gs_sm = e&gs_upl = 2041l6863l0l6975l32l19l0l8l8l0l300l3484l0.13.5.1l25l0&bav = on.2,or.r_gc.r_pw。,cf.osb&fp = d6b7c50fe1987ca1&biw = 1366&bih = 655 – 2011-12-17 15:29:49

+1

被問了很多次。請下次搜索http://stackoverflow.com/questions/908850/get-installed-applications-in-a-system – 2011-12-17 15:31:13

回答

1

使用WMI:

var query = new ManagementObjectSearcher("SELECT * FROM Win32_Product"); 
var res = from ManagementObject m in query.Get() where m.Properties["Name"].Value.ToString() == "Flash Player"; // I don't know the name of flash player installer 
if (res.Count > 0) { ... } 
1

另一種方法是檢查SWF文件的文件關聯。這將指向一個標識符,告訴你Flash的版本如「ShockwaveFlash.ShockwaveFlash.10」。例如:

var subKey = Registry.ClassesRoot.OpenSubKey(@"ShockwaveFlash.ShockwaveFlash\CurVer"); 
if (subKey != null) 
{ 
    var value = subKey.GetValue(null) as String; 
    // TODO: parse the number after the last period in the string. 
} 
相關問題