FileInfo.LastAccessTime : FileInfo « System.IO « C# / C Sharp by API






FileInfo.LastAccessTime

 

using System;
using System.Windows.Forms;
using System.IO;

public class Example15_5 
{
    
    [STAThread]
  public static void Main() 
  {

    // create and show an open file dialog
    OpenFileDialog dlgOpen = new OpenFileDialog();
    if (dlgOpen.ShowDialog() == DialogResult.OK)
    {
      // use the File class to return info about the file
      FileInfo fi = new FileInfo(dlgOpen.FileName);
      Console.WriteLine("Filename " + fi.FullName );
      Console.WriteLine(" Created at " + fi.CreationTime );
      Console.WriteLine(" Accessed at " + fi.LastAccessTime );
    }

  }

}

   
  








Related examples in the same category

1.new FileInfo(String fileName)
2.FileInfo.Attributes
3.FileInfo.Create()
4.FileInfo.CreationTime
5.FileInfo.CopyTo(String fileName)
6.FileInfo.Delete
7.FileInfo.Directory
8.FileInfo.FullName
9.FileInfo.MoveTo(String path)
10.FileInfo.Open
11.FileInfo.OpenRead
12.FileInfo.OpenText
13.FileInfo.OpenWrite()