"System.Web.HttpContext.Current.Request.ServerVariables", MSDN ServerVariables :
int loop1, loop2;
NameValueCollection coll;
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 + ": " + Server.HtmlEncode(arr2[loop2]) + "<br>");
}
}
In addition, it also contains a link to all server variables supported by IIS
For example, the variable "REMOTE_HOST" will give you:
The name of the host making the request. If the server does not have this information, it will set REMOTE_ADDR and leave it empty.
source
share