Internet Explorer のバージョンを取得する

他にも方法はあるだろうがレジストリから取得するのが一番良さそう。
文字列でIEのバージョンを返す。エントリがなく取得に失敗したら null を返す。

public static string getInternetExplorerVersion() {
  string rKeyName = @"SOFTWARE\Microsoft\Internet Explorer";
  string rValueName = "Version";

  try {
    Microsoft.Win32.RegistryKey rKey = 
        Microsoft.Win32.Registry.LocalMachine.OpenSubKey(rKeyName);
    string sVersion = (string)rKey.GetValue(rValueName);
    rKey.Close();

    return sVersion;
  } catch (NullReferenceException) {
    return null;
  }
}