private CreateSubdirectory ( String path ) : |
||
path | String | |
return |
using System.IO; DirectoryInfo currentDir = new DirectoryInfo("."); currentDir.CreateSubdirectory("newFolder");
using System.IO; DirectoryInfo currentDir = new DirectoryInfo("."); currentDir.CreateSubdirectory("parentFolder/childFolder/grandChildFolder");In this example, we create a DirectoryInfo object for the current directory (denoted by "."). We then call CreateSubdirectory method with a path string "parentFolder/childFolder/grandChildFolder" to create multiple nested subdirectories. Package Library: This method is part of the .NET Framework Class Library, which is included in the standard install of Microsoft Visual Studio.