Snippets

Here is your code snippet

Code


check a directory exists

check a directory exists

using System;
using System.IO;

namespace csharp
{
class Class1
{
static void Main(string[] args)
{

if (Directory.Exists(@"d:\windows"))
{
Console.WriteLine("Directory exists");
}
else
{
Console.WriteLine("Does not exist");
}

}
}
}