using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Tool_login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string n = this.TextBox1.Text.Trim();
        string p = this.TextBox2.Text.Trim();
        if (n.ToLower().Trim() == "xqxujun" && p.ToLower().Trim() == "nishizhua")
        {
            Session["admin"] = "admin";
            Response.Redirect("index.aspx");
        }
        else
        {
            this.RegisterStartupScript("", "<script>alert('用户名或密码错误！');</script>");
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        if (Session["admin"] == null)
        {
            this.RegisterStartupScript("", "<script>alert('您无权进行此操作');</script>");
            return;
        }
        else
        {
            WebClass.ReMoveCacheByKey("AllLinks");
            WebClass.ReMoveCacheByKey("NewTop10");
            WebClass.ReMoveCacheByKey("topTenNew");
            this.RegisterStartupScript("", "<script>alert('清理成功！');</script>");
        }
    }
}
