File.GetLastAccessTime Method
When it is called by trusted applications, returns the date and time the specified file or directory was last accessed.
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Parameters
- path
- Type: System.String
The file or directory for which to obtain access date and time information.
Return Value
Type: System.DateTimeA DateTime structure set to the date and time that the specified file or directory was last accessed. This value is expressed in local time.
| Exception | Condition |
|---|---|
| UnauthorizedAccessException | The caller does not have the required permission. |
| ArgumentException | path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by GetInvalidPathChars. |
| ArgumentNullException | path is null. |
| 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. |
| NotSupportedException | path is in an invalid format. |
For more information about trusted applications, see Trusted Applications.
Platform Notes
Silverlight for Windows Phone
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.