ASP.Net/Response/Server Variables — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 11:54, 26 мая 2010

Showing ServerVariable values via the ServerVariables Collection (VB.net)

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Showing ServerVariable values via the ServerVariables Collection in ASP.NET</title>
   </head>
<body>

<%
Dim Counter1, Counter2 As Integer
Dim Keys(), subKeys() As String
Dim SVarsColl As NameValueCollection
SVarsColl=Request.ServerVariables
Keys = SVarsColl.AllKeys
For Counter1 = 0 To Keys.GetUpperBound(0)
   Response.Write("Key: " & Keys(Counter1) & "<br>")
   subKeys = SVarsColl.GetValues(Counter1) " Get all values under this key.
   For Counter2 = 0 To subKeys.GetUpperBound(0)
      Response.Write("Value " & CStr(Counter2) & ": " & subKeys(Counter2) & "<br>")
   Next Counter2
Next Counter1
%>

</body>
</html>