Home Programs Create a Directory in C#

Create a Directory in C#

In this example we show how to create a new directory in C#


The new Directory is created on the J drive directory using the CreateDirectory() function.

You may need to change the directory name you want to create and the name of the directory

using System;
using System.IO;
using System.Text;

namespace ConsoleApp1
    class Program
        static void Main(string[] args)
            Console.WriteLine("MyDirectory is Created in the J Drive");

You should see a message like this

MyDirectory is Created in the J Drive

You may also like