Asp.net源码专业站
首页->博客空间->chx99个人主页源码>>admin/delimg.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:chx99个人主页源码
当前文件:文件类型 chx99/admin/delimg.aspx.cs[1K,2009-6-12 11:35:58]打开代码结构图
普通视图
		            
1using System; 2using System.Collections; 3using System.Configuration; 4using System.Data; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.HtmlControls; 9using System.Web.UI.WebControls; 10using System.Web.UI.WebControls.WebParts; 11using System.IO; 12using System.Data.OleDb; 13 14public partial class admin_delimg : System.Web.UI.Page 15{ 16 protected void Page_Load(object sender, EventArgs e) 17 { 18 if (Request.QueryString["did"] != null) 19 { 20 try 21 { 22 int id = Convert.ToInt32(Request.QueryString["did"]); 23 24 ImgUploads ui = new ImgUploads(); 25 26 //删除文件 27 DataSet ds = ui.GetID(id); 28 DataTable dt = ds.Tables[0]; 29 string Ipath = Server.MapPath("../" + dt.Rows[0]["path"].ToString()); 30 File.Delete(Ipath); 31 32 //删除缩略图 33 string Tpath = Server.MapPath("../thumbar/"+dt.Rows[0]["id"].ToString()+".jpg"); 34 File.Delete(Tpath); 35 36 37 //删除数据库记录 38 ui.DelImg(id); 39 Page.RegisterStartupScript("123", "<script>alert('删除成功!');location.href='manimg.aspx?id=" + Request.QueryString["id"].ToString() + "'</script>"); 40 } 41 catch(Exception ex) 42 { 43 Page.RegisterStartupScript("error","<script>alert('删除失败,请重试"+ex.Message.ToString()+"');location.href='manimg.aspx?id="+Request.QueryString["id"].ToString()+"'</script>"); 44 } 45 } 46 } 47} 48
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:chx99个人主页源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146