OpenFileDialog.ShowDialog() : OpenFileDialog « System.Windows.Forms « C# / C Sharp by API






OpenFileDialog.ShowDialog()

 

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

class MainClass
{
  public static void Main() 
  {
    OpenFileDialog dlgOpen = new OpenFileDialog();
    if (dlgOpen.ShowDialog() == DialogResult.OK)
    {
      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 OpenFileDialog()
2.OpenFileDialog.CheckFileExists
3.OpenFileDialog.FileOk
4.OpenFileDialog.Filter
5.OpenFileDialog.FilterIndex
6.OpenFileDialog.InitialDirectory
7.OpenFileDialog.Multiselect
8.OpenFileDialog.RestoreDirectory
9.OpenFileDialog.ShowReadOnly
10.OpenFileDialog.Title