PathGetDirectoryName Method |
Returns the directory information for the specified path string.
Namespace: System.IOAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static string GetDirectoryName(
string path
)
Parameters
- path
- Type: SystemString
The path of a file or directory.
Return Value
Type:
StringDirectory information for
path, or null if
path denotes a root directory or is null. Returns
Empty if
path does not contain directory information.
Exceptions Exception | Condition |
---|
ArgumentException | The path parameter contains invalid characters, is empty, or contains only white spaces. |
PathTooLongException | The path parameter is longer than the system-defined maximum length. |
See Also