application|session| variable | Server often write ASP, need to define application variable, session variable, sometimes check correctness. Although there are similar procedures on the Internet, but found that there are many deficiencies, so I wrote a.
The code is as follows:
<% @LANGUAGE = "JavaScript" codepage= "936"%>
<%
Response.Expires = 0;
Response.Buffer = true;
var tpagestarttime = new Date ();
%>
<title> website-application variable-session variable </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<style type=text/css>
BODY,TD {font-size:10pt; font-family: "Arial", "Helvetica", "Sans-serif"}
. Table1 {border-right: #FF9900 1px solid; Border-top: #FF9900 1px solid; font-size:9pt; Border-left: #FF9900 1px solid; Border-bottom: #FF9900 1px solid}
. Table2 {background-color: #FF9900}
. TR1 {background-color: #FF9955}
. TD1 {border-right: #FEDFB3 1px solid; Border-top: #FEDFB3 1px solid; Border-left: #FEDFB3 1px solid; Color: #ff9900; Border-bottom: #FEDFB3 1px solid; Background-color: #FEDFB3}
. TD2 {background-color: #FEEED6;p adding:7px;}
</STYLE>
<table width= "750" border= "0" cellpadding= "3" cellspacing= "1" class= "Table1" >
<tr>
<TD class= "TR1" >
<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<td><font color= "#FFFFFF" face= "Verdana, Arial, Helvetica, Sans-serif" > <strong> server application variables [total <%=Application.Contents.Count%>]
<script>showtools ();</script></strong></font></td>
<TD align= "right" > </td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table width= "100%" border= "0" cellpadding= "3" cellspacing= "1" class= "Table2" >
<tr>
<TD width= "35%" class= "TD1" > Variable </td>
<TD width= "65%" class= "TD1" > Value </td>
</tr>
<%
var icount = 0;
var svartype = "";
var oapplication = new Enumerator (application.contents);
var oapp;
for (;! Oapplication.atend (); Oapplication.movenext ()) {
oapp = Oapplication.item ();
Svartype = typeof (Application.Contents (oapp));
++icount;
%>
<tr>
<TD align= "left" valign= "Middle" class= "TD2" ><b><%=oapp%></b><br><i disabled>[ <%if (svartype== "Unknown") {Response.Write ("Array");} Else{response.write (Svartype);} %>]</i></td>
<TD valign= "Middle" class= "TD2" >
<%
try{
if (svartype== "Unknown") {
var otmp = new VBArray (application.contents (oapp));
Response.Write (Server.HTMLEncode (Otmp.toarray ()));
}else Response.Write (Server.HTMLEncode (Application.Contents (oapp)));
}catch (e) {
Response.Write ("<i disabled>[unknow]</i>");
}
%>
</td>
</tr>
<%
}
if (!icount) {
%>
<tr>
<TD align= "left" valign= "Middle" class= "TD2" colspan= "2" > No application variable </td>
</tr>
<%
}
%>
</table></td>
</tr>
<tr>
<TD height= "5" class= "TR1" colspan= "2" ></td>
</tr>
</table>
<br>
<table width= "750" border= "0" cellpadding= "3" cellspacing= "1" class= "Table1" >
<tr>
<TD class= "TR1" >
<table width= "100%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<td><font color= "#FFFFFF" face= "Verdana, Arial, Helvetica, Sans-serif" > <strong> server Session variables [Total < %=session.contents.count%> A]
<script>showtools ();</script></strong></font></td>
<TD align= "Right" > Current session Number: <%=Session.SessionID%> </td>