Syntax:
bool DirectoryInfo.Exists
Program:
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");
}
}
}
Output:
Directory exists