<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.Cache_UI_List"  CodePage="65001" intPageSize="25" %>

<script language="C#" runat="server">

public string _CacheNamePrefix="";
public void ClearCacheSub()
{

_CacheNamePrefix =(Request.Form["CacheName"]!=null? Request.Form["CacheName"].ToString():"");
//Response.Write(_CacheNamePrefix);
//WinLibClass.Cache.CacheUtils.RemoveCache(_CacheNamePrefix); 

WinLibClass.Cache.CacheUtils.RemoveCache("Ajax_Game3_CurrentState_");

}

//∮

public void SubList()
{

			string CacheNameKey = _CacheNamePrefix;

            System.Web.Caching.Cache cache = this.Cache;//new System.Web.Caching.Cache();//System.Web.HttpContext.Current.Cache;
			System.Collections.IDictionaryEnumerator CacheEnum = System.Web.HttpContext.Current.Cache.GetEnumerator();
			//System.Collections.IDictionaryEnumerator CacheEnum = cache.GetEnumerator();
            string tmp = "";
			//CacheEnum.Reset ();
            while (CacheEnum.MoveNext())
            {
                //if(CacheEnum.Key.ToString().IndexOf(CacheNameKey)>-1)
                tmp = CacheEnum.Key.ToString();
				//Response.Write(CacheEnum.Entry.Key+"<br />");
				
				if(CacheNameKey=="")
				{
					Response.Write("+Clear="+CacheEnum.Key.ToString()+"<br />");
				//	cache.Remove(CacheEnum.Key.ToString());
				}
				else
				
				{
				
                if (tmp.Length >= CacheNameKey.Length && tmp.Substring(0, CacheNameKey.Length) == CacheNameKey)
				{
                    //cache.Remove(CacheEnum.Key.ToString());
					Response.Write("+Clear="+CacheEnum.Key.ToString()+"<br />");
					cache.Remove(CacheEnum.Key.ToString());
				}
				else
				{
					Response.Write("NoClear="+CacheEnum.Key.ToString()+"<br />");
				}
				}
					
            }
}

</script>

<%

ClearCacheSub();
SubList();
%>

<a href="?">刷新</a>
<form action = "Cache_List.aspx" method="post" runat = "server">

<input type="text" id="CacheName" name="CacheName" value="<%=_CacheNamePrefix%>" style="width:300px;"  />
<input type="submit" >
</form>
<table border="1" class="chart" style="width:100%;">

<tr style="height:30px;	font-weight: bold;">
<TH style="width:60px">序号</TH>
<TH style="width:200px">名称</TH>
<TH style="width:150px">到期时间</TH>
<TH style="width:100px">状态</TH>
<TH style="">操作</TH>
</tr>

<asp:Repeater id="rpList" runat="server">
<ItemTemplate>

<tr id="tr_<%#Eval("id")%>">
		<td><%#Eval("id")%></TD>
		<td><%#Eval("key")%></TD>
		<td><%#Eval("value")%></TD>
		<td><%#CacheTypeName(Eval("type"))%></TD>
		<td align="center"><a href="javascript:;"></a></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
<div class="pages cb clearfix"  style="margin-left:13px"><%=strPageInfo%>    
</div>