Program
using System; using System.IO; namespace ConsoleApplication1 { class Program { static void Main() { Console.WriteLine("Delete Empty directory (Empty1)"); Directory.Delete("D:/Empty1"); Console.WriteLine("Delete Empty directory (Empty2)"); Directory.Delete("D:/Empty2",false); Console.WriteLine("Delete Non-Empty directory (India)"); Directory.Delete("D:/India",true); } } }
Output
Delete Empty directory (Empty1) Delete Empty directory (Empty2) Delete Non-Empty directory (India)
Note: In above program, we need to remember, when we use "Directory" class, System.IO namespace must be included in the program.
In this program, method is overloaded, to allow or deny recursive deletion.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Program
Output
Note: In above program, we need to remember, when we use "Directory" class, System.IO namespace must be included in the program.
In this program, method is overloaded, to allow or deny recursive deletion.