Click or drag to resize

DirectoryInfoCreateSubdirectory Method

Creates a subdirectory or subdirectories on the specified path. The specified path can be relative to this instance of the DirectoryInfo class.

Namespace: Crestron.SimplSharp.CrestronIO
Assembly: SimplSharpHelperInterface (in SimplSharpHelperInterface.dll) Version: 2.21.121
Syntax
C#
public DirectoryInfo CreateSubdirectory(
	string dirPath
)

Parameters

dirPath  String
Path to create the DirectoryInfo object. This cannot be a different disk volume or Universal Naming Convention (UNC) name.

Return Value

DirectoryInfo
The last directory specified in path.
Exceptions
ExceptionCondition
InvalidDirectoryLocationExceptionInvalid directory specified.
PathTooLongExceptionThe path is greater than 248 characters.
ArgumentExceptionThe path contains invalid characters.
ArgumentNullExceptionThe path is null.
SecurityExceptionThe user does not have the correct permissions.
DirectoryNotFoundExceptionThe current directory does not Exist.
NotSupportedExceptionThe system does not support access to this file type.
Example
using Crestron.SimplSharp; using Crestron.SimplSharp.CrestronIO;; public class CreateSubDirectory { public static void Main() { // Create a reference to a directory. DirectoryInfo di = new DirectoryInfo("MyDirectory"); // Create a subdirectory in MyDirectory. DirectoryInfo dis = di.CreateSubdirectory("MySubDirectory"); // Process that directory as required. .... } }

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also