zhao159357222
       /// <summary>
        /// 获取IIS版本
        /// </summary>
        /// <returns></returns>
        public static int GetIISVersion()
        {
            DirectoryEntry getEntry = new DirectoryEntry("IIS://localhost/W3SVC/INFO");
            int num = 5;
            try
            {
                num = (int)getEntry.Properties["MajorIISVersionNumber"].Value;
            }
            catch
            {
                return 5;
            }
            switch (num)
            {
                case 6:
                    return 6;

                case 7:
                    return 7;
            }
            return 6;
        } 

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-10-21
  • 2021-06-27
  • 2021-11-28
  • 2021-12-02
猜你喜欢
  • 2021-11-12
  • 2022-12-23
  • 2022-02-23
  • 2022-02-23
  • 2022-01-31
  • 2022-12-23
  • 2021-05-27
相关资源
相似解决方案