tiancai

近日,有一项目要分别获取iis6.0和7.5,然后对进程进行操作~
研究良久,有以下办法获取iis版本.

代码:
DirectoryEntry getEntity = new DirectoryEntry("IIS://localhost/W3SVC/INFO");
string Version = getEntity.Properties["MajorIISVersionNumber"].Value.ToString();
MessageBox.Show("IIS版本号为:" + Version);

注意:
1、此方法同样适用于ASP.net。
2、此方法需引用程序集文件system.directoryservices.dll,使用命名空间:using System.DirectoryServices;

分类:

技术点:

相关文章:

  • 2022-01-31
  • 2021-08-04
  • 2022-02-23
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-12-02
  • 2022-02-07
  • 2022-01-02
  • 2021-06-26
相关资源
相似解决方案