Request. servervariables ["http_user_agent"] <--> return the browser type and version number.
Request. servervariables ["remote_addr"] <--> get the user's IP address
Request. servervariables ["request_method"] <--> obtain the Request Method
Request. servervariables ["local_addr"] <--> get the Server IP Address
Request. servervariables ["SERVER_NAME"] <--> get the server host name
Request. servervariables ["path_info"] <--> get the current executionProgramVirtual Path
Request. servervariables ["path_translated"] <--> obtain the absolute path of the current execution Program
Request. servervariables ["content_length"] <--> obtains the total number of characters in the content sent by the request program.
Request. servervariables ["content_type"] <--> obtain the request information type
Request. servervariables ["rgateway_interface"] <--> obtain the Gateway Interface
Request. servervariables ["QUERY_STRING"] <--> get additional URL Information
Request. servervariables ["script_name"] <--> get the file name of the current program (including the Virtual Path)
Request. servervariables ["server_port"] <--> obtain the port on which the server accepts the request.
Request. servervariables ["server_protocol"] <--> obtain the protocol and version number that the server complies.
Request. servervariables ["http_accept_language"] <--> obtain the user's language
Run the followingCodeAll values of the servervariables set can be retrieved through the calendar of the servervariables set.
Reference content
<% @ Page Language = "C #" %>
<% @ Import namespace = "system. Data" %>
<Script language = "C #" runat = "server">
Public void page_load (Object SRC, eventargs E)
{
// Obtain the servervariables variable set
Namevaluecollection servervariables = request. servervariables;
// Generate a data table. Its usage will be discussed later.
Datatable dt = new datatable ();
Datarow Dr;
DT. Columns. Add (New datacolumn ("environment variable", typeof (string )));
DT. Columns. Add (New datacolumn ("variable value", typeof (string )));
foreach (string singlevariable in servervariables)
{< br> DR = DT. newrow ();
Dr [0] = singlevariable;
Dr [1] = servervariables [singlevariable]. tostring ();
DT. rows. add (DR);
}
maid = new dataview (DT);
maid ();
}< br>
bordercolor = "black"
borderwidth = "1"
gridlines = "both"
cellpadding = "3"
cellspacing = "0"
font-name = "verdana"
font-size = "8pt"
headerstyle-backcolor = "# aaaadd "
alternatingitemstyle-backcolor =" # eeeeee "
/>