Create a Directory c#

Create a Directory


add namespace
using System.IO;

// declare the directory path
string _directoryName = @"C:\test\directory-test";

// check folder exists
if (Directory.Exists(_directoryName))
{
   // ok, the directory exists
}
// if not then create
else
{
   Directory.CreateDirectory(_directoryName);
} 
Create a Directory c# Create a Directory c# Reviewed by Bhaumik Patel on 6:55 AM Rating: 5