Archive

Archive for November, 2009

IIS Server Variables

November 3, 2009 2 comments

IIS server variables provide information about the server, the connection with the client, and the current request on the connection.

IIS server variables are not the same as environment variables.

Paste the code given below in your asp.net web page [HTML Design] to see the information associated for each of the iis server variables.

<%Response.Write(HttpContext.Current.Request.ServerVariables["ALL_HTTP"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["ALL_RAW"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["APPL_MD_PATH"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["AUTH_TYPE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["AUTH_PASSWORD"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["AUTH_USER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_COOKIE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_FLAGS"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_ISSUER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_KEYSIZE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_SECRETKEYSIZE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_SERIALNUMBER"]); %>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_SERVER_ISSUER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CERT_SERVER_SUBJECT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CONTENT_LENGTH"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["CONTENT_TYPE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["GATEWAY_INTERFACE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS_KEYSIZE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS_SECRETKEYSIZE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS_SERVER_ISSUER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTPS_SERVER_SUBJECT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["INSTANCE_ID"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["INSTANCE_META_PATH"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["LOGON_USER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["PATH_INFO"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["PATH_TRANSLATED"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["QUERY_STRING"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["REMOTE_HOST"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["REQUEST_METHOD"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SCRIPT_MAP"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_NAME"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_PORT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_PORT_SECURE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_PROTOCOL"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["SERVER_SOFTWARE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["URL"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_CONNECTION"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_HOST"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_REFERER"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_COOKIE"]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_UA_CPU "]);%>
<%Response.Write(HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_ENCODING"]);%>

References: http://msdn.microsoft.com/en-us/library/ms524602.aspx

Advertisements
%d bloggers like this: