Code
To delete a file on server you can use code like this
[ C# ] // We need this namespaceusing System.IO; public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { string FileToDelete; // Set full path to file FileToDelete = Server.MapPath("~/Files/SomeFile.txt"); // Delete a file File.Delete(FileToDelete); } }
meh lPosted Apr 19, 2011, 1:09 PM
Tks other alternative is System.IO.File.Delete(path of file);
Suthish NairPosted Dec 20, 2010, 10:00 AM
This must be in a blog section not article :)