Thursday, September 10, 2009

Iterate through SeverVariable in ASP.net

public string ServerVariables()
{

System.Collections.Specialized.NameValueCollection oValues =
new System.Collections.Specialized.NameValueCollection();
oValues = Request.ServerVariables;
for(int i=0; i < oValues.Count ; i++)
{
value += string.Format("Key {0} - Text {1}", oValues.Keys[i].ToString(), oValues.Get(i).ToString());
}


return value;
}

No comments:

Post a Comment

 
Locations of visitors to this page