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);
}
}
}
Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/2XpiqY5IMtY/14479