Ensure Folder Exists - CSharp File IO

CSharp examples for File IO:Directory

Description

Ensure Folder Exists

Demo Code


using System.Text.RegularExpressions;
using System.IO;/*from  www  .jav a2 s. c o  m*/
using System.Collections.Generic;
using System;

public class Main{
        public static void EnsureFolderExists(string path)
        {
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
        }
}

Related Tutorials