C# program to demonstrate the use of Exists property

C# program to demonstrate the use of Exists property The article is a lively article because it contains interesting information and your favorite.   

C# program to demonstrate the use of Exists property

C# program to demonstrate the use of Exists property

using System;
using System.IO;

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

            if(d.Exists)
                Console.WriteLine("Directory exists");
            else
                Console.WriteLine("Directory does not exists");
        }
    }
}
Directory exists

Final Words

I hope you find the article C# program to demonstrate the use of Exists property uses. The reason is that we have told you all the information through this article in a way that you can understand. And if you have any doubts, you can express your doubts through the comment box. We also ask that you help share this article with your friends.

Hi, I'm Selva a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment