C# program to showcase the usage of the DirectoryInfo class

Category > CSHARP || Published on : Monday, September 28, 2020 || Views: 831 || DirectoryInfo class


Here Pawan Kumar will explain how to showcase the usage of the DirectoryInfo class

using System;
using System.IO;
namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryInfo di = new DirectoryInfo(@"C:\Project");
            Console.WriteLine("Does the directory exist " + di.Exists);
            Console.WriteLine("The creation time of the directory is "
            + di.CreationTime);
            Console.Read();
        }
    }
}

In this article we have learned DirectoryInfo class and their c# programming uses.