Answers for "if directory not exist create c#"

C#
5

create a directory if it doesnt exist c#

using System.IO;

if(!Directory.Exists("<directory>")){
  Directory.CreateDirectory("<directory>");
}
Posted by: Guest on September-13-2021
-1

Create directory if it does not exist

string currentPath = Directory.GetCurrentDirectory();
if (!Directory.Exists(Path.Combine(currentPath, "ACH")))
    Directory.CreateDirectory(Path.Combine(currentPath, "ACH"));
//at this point your folder should exist
Posted by: Guest on August-12-2021

Code answers related to "if directory not exist create c#"

C# Answers by Framework

Browse Popular Code Answers by Language