C#
Parameters
- path
- The relative or absolute path to the directory to search. This string is not case-sensitive.
Return Value
An enumerable collection of file-system entries in the directory specified by path.Exception | Description |
---|---|
System.ArgumentException | %path %is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the System.IO.Path.GetInvalidPathChars method. |
System.ArgumentNullException | path is a null reference (Nothing in Visual Basic). |
System.IO.DirectoryNotFoundException | path is invalid, such as referring to an unmapped drive. |
System.IO.IOException | path is a file name. |
System.IO.PathTooLongException | The specified path, file name, or combined 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. |
System.Security.SecurityException | The caller does not have the required permission. |
System.UnauthorizedAccessException | The caller does not have the required permission. |
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2