How to programmatically determine installed IIS version

后端 未结 6 1951
别那么骄傲
别那么骄傲 2021-01-17 20:27

What would the preferred way of programmatically determining which the currently installed version of Microsoft Internet Information Services (IIS) is?

I know that i

6条回答
  •  清酒与你
    2021-01-17 20:46

    public int GetIISVersion()
    {
         RegistryKey parameters = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\W3SVC\\Parameters");
         int MajorVersion = (int)parameters.GetValue("MajorVersion");
    
         return MajorVersion;
    }
    

提交回复
热议问题