コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] != null && Request.QueryString["path"] != null)
            {
                //TestimonialDAO tdao = new TestimonialDAO();
                string id       = Request.QueryString["id"];
                string fullPath = Request.QueryString["path"];
                int    id_num   = Convert.ToInt32(id);
                if (!System.IO.File.Exists(fullPath))
                {
                    Response.Redirect("Home.aspx");
                }
                else
                {
                    System.IO.File.Delete(fullPath);
                    Course_elearnDAO cdao = new Course_elearnDAO();
                    cdao.delete_Material(id_num, fullPath);
                    //set audit
                    User   currentUser = (User)Session["currentUser"];
                    string filename    = Path.GetFileName(fullPath);
                    setAudit(currentUser, "course", "update", id, "deleted material link: " + filename);
                }

                Response.Redirect("viewModuleInfo.aspx?id=" + id_num);
            }
        }