protected void btnSubmit_Click(object sender, EventArgs e) { try { FileInfo TheFile = new FileInfo(MapPath(".") + "\\" + txtFile.Text); if (TheFile.Exists) { File.Delete(MapPath(".") + "\\" + txtFile.Text); } else { throw new FileNotFoundException(); } } catch (FileNotFoundException ex) { lblStatus.Text += ex.Message; } catch (Exception ex) { lblStatus.Text += ex.Message; } }
string dbpath=getdbValue() // get it from DB string delfile= System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath +dbpath System.IO.File.Delete(delfile);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)