Get all server variables (VB.net) : Server Variables « Server « ASP.Net






Get all server variables (VB.net)

<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub Page_Load(ByVal Sender as Object, ByVal E as EventArgs)
    Dim NameArray() As String
    Dim VisitorSV As NameValueCollection
    Dim I as Integer
    VisitorSV = Request.ServerVariables
    NameArray = VisitorSV.AllKeys
    For I = 0 To UBound(NameArray)
        If NameArray(I) <> "ALL_HTTP" and _ 
        NameArray(I) <> "ALL_RAW" Then
            lblMessage1.Text = lblMessage1.Text _
                & NameArray(I) & ": " _
                & VisitorSV.Item(I) & "<BR>"
        End If
    Next
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Server Variables Sample Page</TITLE>
</HEAD>
<BODY >
<form runat="server">
<Font Face="Tahoma">
<asp:Label
    id="lblMessage1"
    runat="Server"
    Font-Bold="True"
    FOnt-Size="9"
/>
</Font>
</Form>
</BODY>
</HTML>

           
       








Related examples in the same category

1.All Request Server Variables (VB.net)
2.Request Server Variables Item(REMOTE_ADDRESS) (VB.net)