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 top : System.Web.UI.Page
{
    public string username = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie GetCookie = Request.Cookies["cook_admin"];
        if (Request.Cookies["cook_admin"] == null)
        {
            Response.Redirect("index.aspx");
        }
        DataSet dsname = DbHelperSQL.Query("select realname from etw_admin where etwadminname='" + GetCookie["username"] + "'");
        if (dsname.Tables[0].Rows.Count > 0)
        {
            username = dsname.Tables[0].Rows[0]["realname"].ToString();
        }
    }
    protected void lbtnSignOut_Click(object sender, EventArgs e)
    {
        Response.Cookies["cook_admin"].Expires = DateTime.Now.AddDays(-5);
        Response.Write("<script type=text/javascript>parent.location.reload();</script>");
    }
}
