using System;
using System.Collections;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Collections.Specialized;

namespace flash
{
	/// <summary>
	/// FileCache 的摘要说明。
	/// </summary>
	public class FileCache
	{
		public static readonly Hashtable CacheList = Hashtable.Synchronized(new Hashtable());
		//		public static readonly NameValueCollection CacheList = new NameValueCollection();
		private FileCache(){}

		public static string ApplicationPath
		{
			get
			{
				string tmp = HttpContext.Current.Request.ApplicationPath;
				if (tmp == "/")
				{
					tmp = string.Empty;
				}
				return tmp;
			}
		}

		/// <summary>
		/// 生成首页
		/// </summary>
		public static void RemoveIndex()
		{
			string key = ApplicationPath + "/m.aspx?cn=Index";
			CacheList.Remove(key.ToLower());
		}

		/// <summary>
		/// 生成用户首页
		/// </summary>
		/// <param name="UserName"></param>
		public static void RemoveUserIndex(string UserName)
		{
			string key = ApplicationPath + "/m.aspx?cn=UserIndex&UserName=" + UserName;
			CacheList.Remove(key.ToLower());
		}
	}
}
