.net - How to create multiple directories from a single full path in C#? -


If you have the full path: "C: \ dir0 \ dir1 \ dir2 \ dir3 \ dir4 \" < / Code> How do you implement it so that all directories are present?

Is there a method for this in BCL? If not, what is the most beautiful way to do this?

I will call Directory.CreateDirectory (@ "C: \ dir0 \ dir1 \ dir2 \ Dir3 \ dir4 \ ") .

Unlike popular belief, whatever the original directories are not present will automatically create.
The MSDN word, creates all the directories and subdirectories specified by the path.

If the entire path is already present, then it will not do anything (this will not throw an exception)


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -