<!--#include file="../conn.asp"-->
<!--#include file="admin_check.asp"-->
<!--#include file="../inc/function.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>管理页面</title>
<link id="maincss" rel="stylesheet" href="images/css/admin_style_<%= AdminSkin %>.css" type="text/css" media="all" />
<style type="text/css">
<!--
.connt {
	height: 60px;
	width: 100%;
	overflow: auto;
	word-break:break-all;
}
a.lb{
	color: #009900;
}
a.lb:hover{
	color: #FF6600;
	text-decoration: underline;
}
a.lb1{
	color: #FF0000;
	text-decoration: underline;
	margin-left: 8px;
}
a.lb1:hover{
	color: #0000FF;
	text-decoration: none;
}
-->
</style>
</head>
<body leftmargin="0" bottommargin="0" rightmargin="0" topmargin="5" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">
<%
Call chkFlag(22)
dim act,tname
act=Trim(Request.QueryString("act"))
tname=Trim(Request.QueryString("tname"))
select case act
 case "a"
    call applist()
 case "s"
    call seslist()
 case "removeA"
    call removeA()
 case "removeS"
    call removeS()
 case "removeallA"
    call removeallA()
 case "removeallS"
    call removeallS()
 case "removeTemplate"
    call removeTemplate()
 case else
    call main()
end select

sub removeTemplate()
Dim apps,n
n=0
  For Each apps In Application.Contents
      IF instr(apps,".html")>0 Then
	  n=n+1
	     ReDim Preserve appx(n)
		 appx(n)=apps
	  End IF
  Next
  
  IF n=0 Then Response.Redirect("?"):Exit Sub
  
  For n=0 To ubound(appx)
      application.Contents.Remove(appx(n))
  Next
  Response.Redirect("?")
end sub

sub removeallA()
   application.Contents.RemoveAll()
   Response.Redirect("?")
end sub

sub removeallS()
   session.Contents.RemoveAll()
   Response.Redirect("?")
end sub

sub removeA()
   application.Contents.Remove(tname)
   Response.Redirect("?act=a")
end sub

sub removeS()
   session.Contents.Remove(tname)
   Response.Redirect("?act=s")
end sub

sub main()
%>
<table class="tableBorder" cellspacing="1" cellpadding="2" width="96%" align="center" border="0">
   <tr>
	<th height="25" colspan="2">清理服务器缓存设置</th>
  </tr>
  <tr>
    <td colspan="2" class="TableRow1"><font color="#008800">全局和会话变量：</font>Application 变量 <%=Application.Contents.count%> 个<%if Application.Contents.count>0 then Response.Write "[<a class=""lb"" href=""?act=a"">列表</a>]"%>
    ,  
		Session 变量 <%=Session.Contents.count%> 个  <%if Session.Contents.count>0 then Response.Write "[<a class=""lb"" href=""?act=s"">列表</a>]"%></td>
  </tr>
  <tr>
    <td width="50%" class="TableRow2"><a href="?act=removeallA" class="lb1" onClick="return confirm('您确定操作吗？')">清空所有Application</a></td>
    <td width="50%" class="TableRow2"><a href="?act=removeallS" class="lb1" onClick="return confirm('您确定操作吗？')">清空所有Session</a></td>
  </tr>
  <tr>
    <td class="TableRow1"><a href="?act=removeTemplate" class="lb1" onClick="return confirm('您确定操作吗？')">清空模板缓存</a></td>
    <td class="TableRow1">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="right" class="TableRow2">快问知道并不建议经常清理服务器缓存&nbsp;&nbsp; </td>
  </tr>
</table>
<% End sub

sub applist()
%>
<table class="tableBorder" cellspacing="1" cellpadding="2" width="96%" align="center" border="0">
   <tr>
	<th height="25" colspan="2">Application缓存</th>
  </tr>
  <tr>
    <td width="18%" align="center" class="TableRow1"><strong>变量名称</strong></td>
    <td width="82%" align="center" class="TableRow1"><strong>值</strong></td>
  </tr>
<%
Dim apps,i,c
for each apps in Application.Contents
i=i+1
if i mod 2=0 then c=1 else c=2
%>
  <tr>
    <td align="center" class="TableRow<%= c %>"><%=apps%><br>
[<a class="lb" href="?act=removeA&tname=<%=server.URLEncode(apps)%>">清除</a>]</td>
    <td class="TableRow<%= c %>">
      <div class="connt">
<%
  if isobject(Application.Contents(apps)) then
    Response.Write "[对象]"
  elseif isarray(Application.Contents(apps)) then
    Response.Write "[数组]"
  else
    Response.Write(server.HTMLEncode((Application.Contents(apps))))
  end if
%>
      </div>
    </td>
  </tr>
<%next%>
</table>
<%
end sub


sub seslist()
%>
<table class="tableBorder" cellspacing="1" cellpadding="2" width="96%" align="center" border="0">
   <tr>
	<th height="25" colspan="2">Session变量</th>
  </tr>
  <tr>
    <td width="18%" align="center" class="TableRow1"><strong>变量名称</strong></td>
    <td width="82%" align="center" class="TableRow1"><strong>值</strong></td>
  </tr>
<%
Dim sens,i,c
for each sens in Session.Contents
i=i+1
%>
  <tr>
    <td align="center" class="TableRow1"><%=sens%><br>
[<a class="lb" href="?act=removeS&tname=<%=server.URLEncode(sens)%>">清除</a>]
    </td>
    <td class="TableRow1">
<%
  if isobject(Session.Contents(sens)) then
    Response.Write "[对象]"
  elseif isarray(Session.Contents(sens)) then
    Response.Write "[数组]"
  else
    Response.Write(server.HTMLEncode((Session.Contents(sens))))
  end if
%>
    </td>
  </tr>
<%next%>
</table>
<%
end sub
%>
<br>
</body>
</html>