日期:2014-05-18  浏览次数:20497 次

请教:如何获取IIS的版本。
如何在aspx.cs代码中获取获取当前服务的IIS版本》》?
谢谢!!!!

------解决方案--------------------
string allhttp = Request.ServerVariables[ "HTTP_USER_AGENT "].ToString();
string[] myFilename = allhttp.Split(de);
Server_IIS.Text = myFilename[myFilename.Length - 1].Replace( ") ", " ");
------解决方案--------------------
private void Page_Load(object sender, System.EventArgs e)
{
int loop1, loop2;
NameValueCollection coll = Request.ServerVariables;
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write( "Key: " + arr1[loop1] + " <br> ");
String[] arr2=coll.GetValues(arr1[loop1]);
for (loop2 = 0; loop2 < arr2.Length; loop2++)
{
Response.Write( "Value " + loop2 + ": " + arr2[loop2] + " <br> ");
}
}

string a = Request.ServerVariables [ "SERVER_SOFTWARE " ] ;
Response.Write ( a );

}