Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
LastAccessTimeUtc Property

FileSystemInfo.LastAccessTimeUtc Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed.

[Visual Basic]
<ComVisible(False)>
Public Property LastAccessTimeUtc As DateTime
[C#]
[ComVisible(false)]
public DateTime LastAccessTimeUtc {get; set;}
[C++]
[ComVisible(false)]
public: __property DateTime get_LastAccessTimeUtc();
public: __property void set_LastAccessTimeUtc(DateTime);
[JScript]
public
   ComVisible(false)
function get LastAccessTimeUtc() : DateTime;
public function set LastAccessTimeUtc(DateTime);

Property Value

The UTC time that the current file or directory was last accessed.

Exceptions

Exception Type Condition
IOException Refresh cannot initialize the data.

Remarks

When first called, FileSystemInfo calls Refresh and returns the cached information on APIs to get attributes and so on. On subsequent calls, you must call Refresh to get the latest copy of the information.

This property value is a null reference (Nothing in Visual Basic) if the file system containing the file does not support this information.

The following table lists examples of other typical or related I/O tasks.

To do this... See the example in this topic...
Write to a text file. Writing Text to a File
Read from a text file. Reading Text from a File
Append text to a file. Opening and Appending to a Log File

File.AppendText

FileInfo.AppendText

Rename or move a file. File.Move

FileInfo.MoveTo

Windows 95, Windows 98, Windows 98 Second Edition Platform Note:  These operating systems do not support this property, and DirectoryInfo implementations of this property are not supported.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

FileSystemInfo Class | FileSystemInfo Members | System.IO Namespace | Working with I/O | Reading Text from a File | Writing Text to a File

Show:
© 2015 Microsoft