コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string   mycookie  = "";
            string   mysession = "";
            desclass mydes     = new desclass();

            try
            {
                mysession = Session["username"].ToString();
            }
            catch
            { mysession = null; }

            try
            {
                mycookie = Request.Cookies["name"].Value;
            }
            catch
            {
                mycookie = null;
            }
            string ownname = mydes.yanzheng(mycookie, mysession);

            if (ownname != null)
            {
                gloadmyname = ownname;
                mysql sql = new mysql();
                GridView1.DataSource = sql.viewcode(ownname, "", 1);
                GridView1.DataBind();
            }
            else
            {
                Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["localurl"].ToString() + "login.aspx");
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            desclass mydes     = new desclass();
            string   codeid    = Request["codeid"];
            string   mycookie  = "";
            string   mysession = "";

            try
            {
                mysession = Session["username"].ToString();
            }
            catch
            { mysession = null; }

            try
            {
                mycookie = Request.Cookies["name"].Value;
            }
            catch
            {
                mycookie = null;
            }
            string ownname = mydes.yanzheng(mycookie, mysession);

            if (ownname != null)
            {
                Label1.Text = "你好" + ownname;
                mysql sql = new mysql();
                if (codeid == "" || codeid == null)
                {
                    Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["localurl"].ToString() + "viewcode.aspx"); return;
                }
                GridView1.DataSource = sql.viewcode(codeid, ownname, 2);
                GridView1.DataBind();
            }
            else
            {
                Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["localurl"].ToString() + "login.aspx");
            }
        }
コード例 #3
0
ファイル: editcode.aspx.cs プロジェクト: wilsonleeee/xsstest
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Request["FormView1$button1"].ToString() == "提交编辑代码")
                {
                    mysql   sql      = new mysql();
                    xssfile xs       = new xssfile();
                    string  beizhu   = Request["FormView1$beizhu"];
                    string  document = Request["FormView1$mycodedocument"];
                    string  title    = Request["FormView1$mycodename"];
                    string  codeid   = Request["codeid"];

                    beizhu = xs.filet(beizhu);
                    title  = xs.filet(title);


                    sql.updatecode(codeid, title, document, beizhu);

                    Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["localurl"].ToString() + "success.html");
                    return;
                }
            }
            catch
            {
            }
            string   mycookie  = "";
            string   mysession = "";
            desclass mydes     = new desclass();

            try
            {
                mysession = Session["username"].ToString();
            }
            catch
            { mysession = null; }

            try
            {
                mycookie = Request.Cookies["name"].Value;
            }
            catch
            {
                mycookie = null;
            }
            string ownname = mydes.yanzheng(mycookie, mysession);

            if (ownname != null)
            {
                mycodeid = Request["codeid"];
                if (mycodeid == "" || mycodeid == null)
                {
                    Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["localurl"].ToString() + "viewcode.aspx"); return;
                }
                mynameis = ownname;

                mysql sql = new mysql();

                FormView1.DataSource = sql.viewcode(mycodeid, ownname, 3);
                FormView1.DataBind();
            }
            else
            {
                Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["localurl"].ToString() + "login.aspx");
            }
        }