C# Program to create new directories

CsharpProgrammingServer Side Programming

Use the CreateDirectory method to create a directory.

Let’s say you need to create a directory in D drive. For that, use the CreateDirectory() method as shown below −

Directory.CreateDirectory("D:\\Tutorial");

The following is the code −

Example

using System.IO;
using System;
public class Program {
   public static void Main() {
      Directory.CreateDirectory("D:\\Tutorial");
   }
}
raja
Published on 05-Sep-2018 08:06:36
Advertisements