我怎么能知道下IIS我的Asp.Net应用程序正在运行的版本? [英] How can I know under which IIS version my Asp.Net application is running?
问题描述
我怎么能知道下我的web应用程序在开发服务器运行IIS版本?
作为Net框架2.0,3.0,3.5,4.0已经内置支持IIS ....
感谢
How can I know under which IIS version my web application is running in development server?
As .Net framework 2.0,3.0,3.5,4.0 have support built in IIS....
Thanks
推荐答案
要获取Web服务器的IIS版本,你可以使用SERVER_SOFTWARE的server变量。
To get the IIS version of the webserver you can use the SERVER_SOFTWARE server variable.
Request.ServerVariables["SERVER_SOFTWARE"];
这将返回类似如下:
It will return something like as follows:
微软IIS / 5.0(Windows 2000)的
Microsoft-IIS/5.0 (Windows 2000)
微软IIS / 5.1(Windows XP中)
Microsoft-IIS/5.1 (Windows XP)
微软IIS / 6.0(Windows 2003 Server的)
Microsoft-IIS/6.0 (Windows 2003 Server)
您可以找到服务器变量的完整参考这里 。
You can find a full reference of server variables here.
这篇关于我怎么能知道下IIS我的Asp.Net应用程序正在运行的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!