Directory.Delete : Directory « System.IO « C# / C Sharp by API






Directory.Delete

 
using System;
using System.IO;

class MaionClass
{
  public static void Main(String[] args)
  {
    try
    {
      Directory.Delete(@"C:\WinNT\MyFoo");
      Directory.Delete(@"C:\WinNT\MyBar", true);
    }
    catch(IOException e)
    {
      Console.WriteLine(e.Message);
    }
  }
}

   
  








Related examples in the same category

1.Directory.CreationTime
2.Directory.Exists
3.Directory.GetCurrentDirectory()
4.Directory.GetFiles
5.Directory.GetLogicalDrives
6.Directory.SetCurrentDirectory(String path)