C# FileInfo LastAccessTimeUtc

Description

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

Syntax

FileInfo.LastAccessTimeUtc has the following syntax.


[ComVisibleAttribute(false)]
public DateTime LastAccessTimeUtc { get; set; }

Example

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


using System;/*from   w  w w.  j  a v  a  2  s . co  m*/
using System.IO;

public class DirectoryTest 
{
    public static void Main() 
    {
        FileInfo fi = new FileInfo("temp.txt");

        Console.WriteLine(fi.LastAccessTimeUtc);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter