file.create folder c#
string path1 = @"C:\temp\";
string path2 = Path.Combine(path1, "temp1");
// Create directory temp1 if it doesn't exist
Directory.CreateDirectory(path2);
3.67
3
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);
Thank you!
3
0
3.67
10
// Directory class is in the System.IO namespace
Directory.CreateDirectory(dir);
Thank you!
10
0
Are there any code examples left?
New code examples in category C#
-
C# 2022-03-28 00:40:23 c# movement script
-
C# 2022-03-28 00:15:17 Delete last modification on EntityFramework Core
-
C# 2022-03-27 21:25:04 Error inflating class android.support.constraint.ConstraintLayout
-
C# 2022-03-27 21:15:02 top down shooting in unity 2D
-
C# 2022-03-27 20:50:02 c# remove invalid directory characters
-
C# 2022-03-27 20:30:07 how to use K2 games Games parallax background
-
C# 2022-03-27 20:25:10 c# replace crlf
-
C# 2022-03-27 20:25:09 keycode for left mouse click unity