DirectoryInfo.CreateSubdirectory()
This is a method of "DirectoryInfo" class, it is used to create a sub directory within a directory.
Syntax:
DirectoryInfo DirectoryInfo.CreateSubdirectory(string path);
Parameter(s):
- path - Sub-Directory name.
Return value:
Returns the object of DirectoryInfo class.
Program
Output
In this program we create an object of DirectoryInfo class and initialize with a directory-name, then create sub-directory inside given directory.
Note: In above program, we need to remember, when we use "DirectoryInfo" class, System.IO namespace must be included in the program.