using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Web.Caching;
using System.Configuration;
namespace baoge.Admin
{
	/// <summary>
	/// admin_log 的摘要说明。
	/// </summary>
	public class admin_log : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.DataGrid DataGrid1;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			if(Session["AdminName"]==null)
			{
				Response.Redirect("Admin_Login.aspx");
			}
			if(!this.IsPostBack)
			{
				suyuan();
			}
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		public void suyuan()
		{
			DataView Source = (DataView)Cache["MyData"];
			if(Source == null) 
			{
				DataSet ds = new DataSet();
				FileStream fs = new FileStream(Server.MapPath("LoginMsg.xml"), FileMode.Open,FileAccess.Read);
				StreamReader reader = new StreamReader(fs);
				ds.ReadXml(reader);
				fs.Close();
				Source = new DataView(ds.Tables[0]);
				Cache.Insert("MyData", Source, new CacheDependency(Server.MapPath("LoginMsg.xml")));
				
			
				this.DataGrid1.DataSource = Source;
				this.DataGrid1.DataBind();
			}
		}

		
		

		
		

		

		
	}
}
