string imagePath = Server.MapPath("~/ProImage/") + drResult["kp_url"].ToString().Trim();
int a = imagePath.Substring(imagePath.LastIndexOf("//")).Trim().Length; //此处用来判断该物料是否有图片,否则从服务器删除空文件会报错
if (a > 1)
{
System.IO.File.Delete(imagePath);
}
// if (imagePath.Trim().Length > 0)
//{
//删除文件
// File.Delete(imagePath);
//}
dt.Rows.Find(e.CommandArgument.ToString()).Delete();