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);
}
时间: 2024-10-01 00:47:46