Ensure Parent Exists - CSharp File IO

CSharp examples for File IO:Directory

Description

Ensure Parent Exists

Demo Code


using System.Text.RegularExpressions;
using System.IO;//from   ww  w .ja va  2  s  .  co m
using System.Collections.Generic;
using System;

public class Main{
        public static void EnsureParentExists(string path)
        {
            var parentPath = Path.GetDirectoryName(path);
            
            EnsureFolderExists(parentPath);
        }
}

Related Tutorials