System.Web Namespace HttpRequest Class
Gets a collection of web server variables.
[ VB ]
Public ReadOnly Property ServerVariables As NameValueCollection
[ C# ]
public NameValueCollection ServerVariables {get;}
[ C++ ]
public: __property NameValueCollection* get_ServerVariables ( );
[ JScript ]
public function get ServerVariables ( ) : NameValueCollection;
A NameValueCollection of server variables.
The following example [ C# ] shows how you can dynamically retrieve and display the names and values of all server variables into an HTML table.
<table class="data" width="90%">
<tr>
<th>Server Variable</th>
<th>Value</th></tr>
<% string val;
foreach ( string name in Request.ServerVariables ) {
If ( Request.ServerVariables[ name ] != "" ) val = Request.ServerVariables[ name ];
else val = " "; %>
<tr>
<td><%= name %></td>
<td><%= val %></td></tr>
<% } %>
</table>
Show me
HttpRequest Members