Exemplo n.º 1
0
 public ContentResult ImagesDelete(int id)
 {
     bizUserImages bi = new bizUserImages();
     UserImages model = bi.Get(id);
     if (model == null || model.UserID != UserID)
         return Content("����Ȩɾ����ͼƬ");
     try
     {
         //return Content(Images.GetPhysicsPath(model.ImagePath, ConfigurationManager.AppSettings["ImagePath"]));
         System.IO.File.Delete(Images.GetPhysicsPath(model.ImagePath, ConfigurationManager.AppSettings["ImagePath"]));
         System.IO.File.Delete(Images.GetPhysicsPath(model.ImageSmallPath, ConfigurationManager.AppSettings["ImagePath"]));
         bi.Delete(model.UserImageID);
         return Content("");
     }
     catch { return Content("ɾ��ʧ��"); }
 }