Here is a quick way you can get a Version out of it:
Note that I typed it in notepad so it could have errors, but the idea should work :)
Version GetIisVersion() {
using (RegistryKey componentsKey =
Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\INETSTP\Components", false)) {
if (componentsKey != null) {
int majorVersion = (int)componentsKey.GetValue("MajorVersion", -1);
int minorVersion = (int)componentsKey.GetValue("MinorVersion", -1);
if (majorVersion != -1 && minorVersion != -1) {
return new Version(majorVersion, minorVersion);
}
}
return new Version(0, 0);
}