RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
.Net如何获取iis版本?
近日,有一项目要分别获取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;

新闻名称:.Net如何获取iis版本?
当前网址:http://sczitong.cn/article/jgohpi.html