illustrates the FileInfo class : File : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » File »

 

illustrates the FileInfo class









    

/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/

 /*
  Example15_5.cs illustrates the FileInfo class
*/

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 );
    }

  }

}


           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» File