<% Option Explicit
Function ShowHead()
ShowHead = "<html><head><title>ASP.info</title>" & _
"</head><style>.headline, .anchor, .text, H2, " & _
".anchor2 {font-family: Arial, Helvetica, " & _
"sans-serif;} .headline {color: #000000; font-size:" & _
" 20px; font-weight: 800;} .anchor, .text, " & _
".anchor2 {color: #000000; font-size: 13px; " & _
"background-color: #ccccdd;} .anchor, .anchor2 {" & _
"background-color: #d7d7dd; font-weight: 800;" & _
"} TR {background-color: #cccccc;} H2 {" & _
"text-align: center; font-size: 18px; color: #000000;" & _
"} .anchor2 {background-color: #9999dd;}</style><body>"
End Function
Function BuildTable(ByVal strName, ByRef dicValues, _
ByVal boolShowHead)
Dim strResult
Dim strKey
strResult = "<h2>" & strName & "</h2>" & _
"<table cellspacing=""1"" cellpadding=""3"" " & _
"border=""0"" width=""75%"" " & _
"align=""center"" bgcolor=""#000000"">"
If boolShowHead Then
strResult = strResult & "<tr><td class=""" & _
"anchor2"">Name</td><td class=""" & _
"anchor2"">Value</td></tr>"
End If
For Each strKey In dicValues
strResult = strResult & "<tr><td class=""" & _
"anchor"">" & strKey & "</td><td class=""" & _
"text"">" & dicValues(strKey) & "</td></tr>"
Next
strResult = strResult & "</table>"
BuildTable = strResult
End Function
Function ShowVersions()
Dim strResult
strResult = "<table cellspacing=""1"" " & _
"cellpadding=""3"" border=""0"" width=""75%"" " & _
"align=""center"" bgcolor=""#000000""><tr>" & _
"<td width=""100%"" class=""headline"" " & _
"style=""background-color: #cccccc;"">"
strResult = strResult & _
ScriptEngine & " " & _
ScriptEngineMajorVersion & "." & _
ScriptEngineMinorVersion & ", Build " & _
ScriptEngineBuildVersion
strResult = strResult & "</td></tr></table>"
ShowVersions = strResult
End Function
Function ShowGeneralInformations()
Dim dicValues
Set dicValues = CreateObject("Scripting.Dictionary")
dicValues.Add "Server", Request.ServerVariables("SERVER_SOFTWARE")
dicValues.Add "Name", Request.ServerVariables("SERVER_NAME")
dicValues.Add "Adress", Request.ServerVariables("LOCAL_ADDR")
dicValues.Add "Port", Request.ServerVariables("SERVER_PORT")
ShowGeneralInformations = BuildTable( _
"General", dicValues, False)
dicValues.RemoveAll
Set dicValues = Nothing
End Function
Function ShowApplication()
Dim dicValues
Dim strKey
Dim strResult
Set dicValues = CreateObject("Scripting.Dictionary")
For Each strKey in Application.Contents
If Not dicValues.Exists(strKey) Then
dicValues.Add strKey, ""
End If
If IsObject(Application(strKey)) Then
dicValues(strKey) = "Object: " & _
TypeName(Application(strKey))
ElseIf IsArray(Application(strKey)) Then
dicValues(strKey) = "Array: " & _
UBound(Application(strKey)) - _
LBound(Application(strKey)) & _
" elements"
Else
dicValues(strKey) = Application(strKey)
End If
Next
If dicValues.Count > 0 Then
strResult = BuildTable("Application", _
dicValues, True)
else
strResult = ""
End If
ShowApplication = strResult
dicValues.RemoveAll
Set dicValues = Nothing
End Function
Function ShowSession()
Dim dicValues
Dim strKey
Dim strResult
Set dicValues = CreateObject("Scripting.Dictionary")
dicValues.Add "SessionID", Session.SessionID
dicValues.Add "TimeOut", Session.TimeOut
dicValues.Add "Codepage", Session.Codepage
dicValues.Add "LCID", Session.LCID
For Each strKey in Session.Contents
If Not dicValues.Exists(strKey) Then
dicValues.Add strKey, ""
End If
If IsObject(Session(strKey)) Then
dicValues(strKey) = "Object: " & _
TypeName(Session(strKey))
ElseIf IsArray(Session(strKey)) Then
dicValues(strKey) = "Array: " & _
UBound(Session(strKey)) - _
LBound(Session(strKey)) & _
" elements"
Else
dicValues(strKey) = Session(strKey)
End If
Next
ShowSession = BuildTable("Session", _
dicValues, True)
dicValues.RemoveAll
Set dicValues = Nothing
End Function
Function ShowServerVariables()
Dim dicValues
Dim strKey
Dim strResult
Set dicValues = CreateObject("Scripting.Dictionary")
For Each strKey in Request.ServerVariables
If Not dicValues.Exists(strKey) Then
dicValues.Add strKey, ""
End If
dicValues(strKey) = Request.ServerVariables(strKey)
Next
ShowServervariables = BuildTable( _
"Server-Variables", dicValues, True)
dicValues.RemoveAll
Set dicValues = Nothing
End Function
Response.Write ShowHead & _
ShowVersions & _
ShowGeneralInformations & _
ShowApplication & _
ShowSession & _
ShowServerVariables %>