DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Delete All The Files In Directory In Asp.net
// Delete all the files in directory in asp.net
private void DeleteDirectoryFiles(string path)
{
if (Directory.Exists(HttpContext.Current.Server.MapPath(path)))
{
string[] files= System.IO.Directory.GetFiles(HttpContext.Current.Server.MapPath(path));
foreach (string file in files)
{
File.Delete(file);
}
}
}




