Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

directoryexistshttpcontextcurrentservermappathpath

Delete all the files in directory in asp.net
Friday, 27 January 2012 10:43
// 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);
}
}
}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/2XpiqY5IMtY/14479

 


Taxonomy by Zaragoza Online