Sprache:

aspinfo()

Sprache: English
Programmiersprache: VBScript
Veröffentlicht von: Dennis Pallett [nicht registriert]
Letzte Änderung: 09.05.2006
Aufrufe: 1445

Beschreibung

If you've ever seen the phpinfo(), you'd wish there was a aspinfo(). Until know there wasn't, but with this handy function, called aspinfo(), you can easily view all the information about your server and several other things.

Code

1 <% 2 '// Call aspinfo() 3 aspinfo() 4 5 6 Sub aspinfo() 7 Dim strVariable, strASPVersion 8 Dim strCookie, strKey, strSession 9 10 'Retrieve the version of ASP 11 strASPVersion = ScriptEngine & " Version " & _ 12 ScriptEngineMajorVersion & "." & _ 13 ScriptEngineMinorVersion 14 %> 15 <!DOCTYPE HTML Public "-//W3C//DTD HTML 4.01 Transitional//EN"> 16 <html> 17 <head> 18 <style type="text/css"><!-- 19 a { text-decoration: none; } 20 a:hover { text-decoration: underline; } 21 h1 { font-family: arial, helvetica, sans-serif; font-size: 18pt; font-weight: bold;} 22 h2 { font-family: arial, helvetica, sans-serif; font-size: 14pt; font-weight: bold;} 23 body, td { font-family: arial, helvetica, sans-serif; font-size: 10pt; } 24 th { font-family: arial, helvetica, sans-serif; font-size: 10pt; font-weight: bold; } 25 //--></style> 26 <title>aspinfo()</title></head> 27 28 <body> 29 <div align="center"> 30 <table width="80%" border="0" bgcolor="#000000" cellspacing="1" cellpadding="3"> 31 <tr> 32 <td align="center" valign="top" bgcolor="#FFFFAE" align="left" colspan="2"> 33 <h3>ASP (<%= strASPVersion %>)</h3> 34 </td> 35 </tr> 36 </table> 37 38 <br> 39 <hr> 40 <br> 41 42 <h3>Server Variables</h3> 43 <table width="80%" border="0" bgcolor="#000000" cellspacing="1" cellpadding="3"> 44 <% 45 For Each strVariable In Request.ServerVariables 46 Response.write("<tr>") 47 Response.write("<th width=doublequote30%doublequote bgcolor=doublequote#FFFFAEdoublequote align=doublequoteleftdoublequote>" & strVariable & "</th>") 48 Response.write("<td bgcolor=doublequote#FFFFD9doublequote align=doublequoteleftdoublequote>" & Request.ServerVariables(strVariable) & "&nbsp;</td>") 49 Response.write("</tr>") 50 Next 'strVariable 51 %> 52 </table> 53 54 <br> 55 <hr> 56 <br> 57 58 <h3>Cookies</h3> 59 <table width="80%" border="0" bgcolor="#000000" cellspacing="1" cellpadding="3"> 60 <% 61 For Each strCookie In Request.Cookies 62 If Not Request.Cookies(strCookie).HasKeys Then 63 Response.write("<tr>") 64 Response.write("<th width=doublequote30%doublequote bgcolor=doublequote#FFFFAEdoublequote align=doublequoteleftdoublequote>" & strCookie & "</th>") 65 Response.write("<td bgcolor=doublequote#FFFFD9doublequote align=doublequoteleftdoublequote>" & Request.Cookies(strCookie) & "&nbsp;</td>") 66 Response.write("</tr>") 67 Else 68 For Each strKey In Request.Cookies(strCookie) 69 Response.write("<tr>") 70 Response.write("<th width=doublequote30%doublequote bgcolor=doublequote#FFFFAEdoublequote align=doublequoteleftdoublequote>" & strCookie & "(" & strKey & ")</th>") 71 Response.write("<td bgcolor=doublequote#FFFFD9doublequote align=doublequoteleftdoublequote>" & Request.Cookies(strCookie)(strKey) & "&nbsp;</td>") 72 Response.write("</tr>") 73 Next 74 End If 75 Next 76 %> 77 </table> 78 79 <br> 80 <hr> 81 <br> 82 83 <h3>Session Cookies</h3> 84 <table width="80%" border="0" bgcolor="#000000" cellspacing="1" cellpadding="3"> 85 <% 86 For Each strSession In Session.Contents 87 Response.write("<tr>") 88 Response.write("<th width=doublequote30%doublequote bgcolor=doublequote#FFFFAEdoublequote align=doublequoteleftdoublequote>" & strSession & "</th>") 89 Response.write("<td bgcolor=doublequote#FFFFD9doublequote align=doublequoteleftdoublequote>" & Session(strSession) & "&nbsp;</td>") 90 Response.write("</tr>") 91 Next 92 %> 93 </table> 94 95 <br> 96 <hr> 97 <br> 98 99 <h3>Other variables</h3> 100 <table width="80%" border="0" bgcolor="#000000" cellspacing="1" cellpadding="3"> 101 <tr><th width="30%" bgcolor="#FFFFAE" align="left">Session.sessionid</th><td bgcolor="#FFFFD9"><%= Session.sessionid %></td></tr> 102 <tr><th width="30%" bgcolor="#FFFFAE" align="left">Server.MapPath</th><td bgcolor="#FFFFD9"><%= Server.MapPath ("/") %></td></tr> 103 </table> 104 </div> 105 106 </body> 107 </html> 108 <% 109 End Sub 110 %>

Noch kein Kommentar vorhanden

Dieses Snippet kommentieren

Name *  

E-Mail (wird nicht angezeigt) *    

Website  

Kommentar *  

Sicherheitscode Sicherheitscode *    

RSS