Mega Code Archive

 
Categories / C# Tutorial / GUI Windows Forms
 

Simple Open file dialog

using System; using System.Drawing; using System.Windows.Forms; public class OpenFileDialogTest{   public static void Main()   {     OpenFileDialog dlg=new OpenFileDialog();     if(dlg.ShowDialog() == DialogResult.OK)     {       MessageBox.Show("You selected the file "+dlg.FileName);     }   } }