码迷,mamicode.com
首页 > 其他好文 > 详细

一般处理程序中删除文件

时间:2017-06-20 09:38:32      阅读:90      评论:0      收藏:0      [点我收藏+]

标签:exists   cal   convert   ima   exec   ring   str   app   esc   

int id = Convert.ToInt32(context.Request["id"]);
string sql = "select ImgUrl from Contents where ID=" + id;
string url = (string)SqlHelper.ExecuteScalar(sql);
string path = System.Web.HttpContext.Current.Server.MapPath("images/img/");
url = path + url;
if (File.Exists(url))
{
File.Delete(url);
}

一般处理程序中删除文件

标签:exists   cal   convert   ima   exec   ring   str   app   esc   

原文地址:http://www.cnblogs.com/wz9003/p/7052524.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!