C# program to demonstrate the use of CreateSubdirectory method

Syntax:

DirectoryInfo DirectoryInfo.CreateSubdirectory(string path);

Program:

using System;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main()
        {
            DirectoryInfo d = new DirectoryInfo("mydir");

            d.CreateSubdirectory("sub-dir");

            Console.WriteLine("Sub-Directory created successfully");
            
        }
    }
}

Output:

Sub-Directory created successfully.

Leave a Comment

error: Alert: Content is protected!!