public void Del(int d) { Tunnel.BLL.Tunnel_MingXing tmx = new Tunnel.BLL.Tunnel_MingXing(); if (File.Exists(Server.MapPath(tmx.GetModel(d).m_img))) { File.Delete(Server.MapPath(tmx.GetModel(d).m_img)); } tmx.Delete(d); }
public void Del(int d) { try { Tunnel.BLL.Tunnel_MingXing tmx = new Tunnel.BLL.Tunnel_MingXing(); if (File.Exists(Server.MapPath(tmx.GetModel(d).m_img))) { File.Delete(Server.MapPath(tmx.GetModel(d).m_img)); } tmx.Delete(d); } catch (Exception ex) { Console.WriteLine(ex.Message); } }