Answers for "create file and folder c#"

C#
2

how to create a folder in c#

// Directory class is in the System.IO namespace
Directory.CreateDirectory(dir);
Posted by: Guest on March-06-2021
1

how to create a new folder with c#

string dir = @"C:test";
// If directory does not exist, create it
if (!Directory.Exists(dir))
{
    Directory.CreateDirectory(dir);
}
Posted by: Guest on July-17-2021
0

file.create folder c#

Using System.IO; 

//gets the directory where the program is launched from and adds the foldername
string path = Path.Combine(Environment.CurrentDirectory, "foldername");

//Creates a directory(folder) if it doesen't exist
Directory.CreateDirectory(path);
Posted by: Guest on April-11-2021

Code answers related to "create file and folder c#"

C# Answers by Framework

Browse Popular Code Answers by Language