I want to create a simple directory tree like this one, although it doesn't need to have the same name
Do I need to write it like this:
Directory.CreateDirectory("/home/XXX/Documents/Users/Pepe/datos/");
Directory.CreateDirectory("/home/XXX/Documents/Users/Juan");
Is there any option to create "Pepe" and "Juan" in the same string path?
No there's nothing baked into the BCL to do that; you have to call
CreateDirectory
for every one.If you have a collection of directory paths, you can put that inside a loop: