我想检测IE在Vista及以上版本上运行的版本(我正在开发7)。我目前在XP上使用WMI,但似乎不再是这样。我已经找到了答案,到目前为止我找到了以下解决方案:
Using System.Windows.Forms
WebBrowser wb = new WebBrowser;
wb.Version;
SELECT path,filename,extension,version FROM CIM_DataFile WHERE path="\\Program Files\\Internet Explorer\\" AND filename="iexplore" AND extension="exe" AND version>"8.0"
And there is probably a way of looking up in the registry.
是否必须有更优雅的解决方案?