Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Create a folder into My Documents or another Path?

Tags:

c#

Am a newbie in C#. I would like to Create a Folder with a Specific name into My Documents when my Windows Form load and if the Folder Name already exist it does not do anything.

private void Form1_Load(object sender, EventsArgs e)
{

}

Can anyone help me with the codes?

like image 909
The_Little_Cousin Avatar asked Oct 23 '25 04:10

The_Little_Cousin


1 Answers

Special folder enum:

Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "MyDirectory"));
like image 113
Backs Avatar answered Oct 26 '25 14:10

Backs