Click or drag to resize

ExtensionsDirectoryInfoToDirectoryInfo Method

Converts a string to a DirectoryInfo

Namespace:  Cauldron
Assembly:  Cauldron (in Cauldron.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static DirectoryInfo ToDirectoryInfo(
	this string path
)

Parameters

path
Type: SystemString
A string specifying the path on which to create the DirectoryInfo.

Return Value

Type: DirectoryInfo
An instance of DirectoryInfo

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionpath is null.
SecurityExceptionThe caller does not have the required permission.
ArgumentExceptionpath contains invalid characters such as ", <, >, or |.
PathTooLongException The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. The specified path, file name, or both are too long.
See Also