Ejemplo n.º 1
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            mysql sql = new mysql();

            sql.deletecode(GridView1.Rows[e.RowIndex].Cells[1].Text.ToString(), "", 2);

            Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["localurl"].ToString() + "viewcode.aspx");
        }
Ejemplo n.º 2
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            mysql sql = new mysql();

            sql.deletecode(GridView1.Rows[e.RowIndex].Cells[0].Text.ToString(), gloadmyname, 1);
            string filename = sql.selectcode(GridView1.Rows[e.RowIndex].Cells[0].Text.ToString(), gloadmyname, 2);

            if (File.Exists(filename))
            {
                //如果存在则删除
                File.Delete(filename);
            }
            Response.Redirect(System.Configuration.ConfigurationManager.AppSettings["localurl"].ToString() + "viewcode.aspx");
        }
Ejemplo n.º 3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string code = "";
            mysql  sql  = new mysql();

            code = sql.selectcode(mycodeid, mynameis, 1);

            if (code != null)
            {
                Random       ran     = new Random();
                int          RandKey = ran.Next(100, 999);
                string       path    = System.Configuration.ConfigurationManager.AppSettings["localpath"].ToString() + mynameis + "\\" + DateTime.Now.ToFileTimeUtc() + RandKey.ToString() + ".js";
                FileStream   fs      = new FileStream(path, FileMode.Append);
                StreamWriter sw      = new StreamWriter(fs);
                sw.Write(code);
                sw.Close();
                fs.Close();
                Label1.Text = path;
                sql.deletecode(mycodeid, path, 3);
            }
        }