Get the server variable from ASP.Net

It is very often a developer or programmer want to know the system/server variable of a server that without their right to access to the server back-end.

With ASP.Net, you could get the server variable through scripting.

When you need these information from your IIS based server, create a aspx file named variable and place the script as below based on C# or VB.


<% @ Page Language="VB" %>
For Each var as String in Request.ServerVariables
Response.Write(var & " " & Request(var) & "<br>")


<% @ Page Language="C#" %>
foreach (string var in Request.ServerVariables)
  Response.Write(var + " " + Request[var] + "<br>");

Well Done, hope this is useful for the programmer.

Published by

Mick Genie

Mick Genie is the founder of and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.