FileInfo::DirectoryName Property
.NET Framework (current version)
Gets a string representing the directory's full path.
Assembly: mscorlib (in mscorlib.dll)
| Exception | Condition |
|---|---|
| ArgumentNullException | null was passed in for the directory name. |
| PathTooLongException | The fully qualified path is 260 or more characters. |
| SecurityException | The caller does not have the required permission. |
To get the parent directory as a DirectoryInfo object, use the Directory property.
When first called, FileInfo calls Refresh and caches information about the file. On subsequent calls, you must call Refresh to get the latest copy of the information.
FileIOPermission
for reading files. Associated enumeration: System.Security.Permissions::FileIOPermissionAccess
Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Show: