Mono Class Library: System.IO.File Overview | Members

System.IO.File.GetCreationTime Method

Returns the creation date and time of the specified file or directory. [Edit]

public static DateTime GetCreationTime (string path)

Parameters

path
A string containing the name of the file or directory for which to obtain creation date and time information. [Edit]

Returns

A DateTime structure set to the creation date and time for the specified file or directory. This value is expressed in local time.

Platforms that do not support this feature return DateTime.MinValue.

[Edit]

Permissions

TypeReason
System.Security.Permissions.FileIOPermission [Edit] Requires permission to read the specified file or directory. See System.Security.Permissions.FileIOPermissionAccess.Read.

Exceptions

TypeReason
ArgumentExceptionpath is a zero-length string, contains only white space, or contains one or more implementation-specific invalid characters. [Edit]
ArgumentNullExceptionpath is null. [Edit]
System.IO.IOExceptionpath was not found. [Edit]
System.IO.PathTooLongExceptionThe length of path or the absolute path information for path exceeds the system-defined maximum length. [Edit]
System.Security.SecurityExceptionThe caller does not have the required permission. [Edit]
UnauthorizedAccessExceptionThe caller does not have the required permission. [Edit]

Remarks

The path argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.
Note: To obtain the current working directory, see Directory.GetCurrentDirectory.
[Edit]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0