File.GetLastAccessTime : File « System.IO « C# / C Sharp by API






File.GetLastAccessTime

 

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

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

    OpenFileDialog dlgOpen = new OpenFileDialog();
    if (dlgOpen.ShowDialog() == DialogResult.OK)
    {
      string s = dlgOpen.FileName;
      Console.WriteLine("Filename " + s);
      Console.WriteLine(" Created at " + File.GetCreationTime(s));
      Console.WriteLine(" Accessed at " + 
       File.GetLastAccessTime(s));
    }

  }

}

   
  








Related examples in the same category

1.File.CreateText(String fileName)
2.File.Delete
3.File.Exists(String fileName)
4.File.OpenRead
5.File.OpenText
6.File.OpenWrite
7.File.ReadAllLines(String fileName)
8.File.SetAccessControl
9.File.WriteAllLines(String fileName, String[] lines)