CSharp examples for File IO:Directory
Checks if the specified directory exists and create it if not present.
using System.IO;//from w w w .j a va 2 s. co m public class Main{ /// <summary> /// Checks if the specified directory exists and create it if not present. /// </summary> /// <param name="directoryName">Name of the directory.</param> public static void CheckIfExistsAndCreate(string directoryName) { if (!Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } } }