C# Open File Dialog

      1 Comment on C# Open File Dialog
            // Configure open file dialog box 
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.Title = "Select File"; // dialog title
            dlg.FileName = ""; // Default file name 
            dlg.DefaultExt = ".csv"; // Default file extension 
            dlg.Filter = "CSV File (.csv)|*.csv|All Files (*.*)|*.*"; // Filter files by extension 

            // Show the dialog and process result
            if (dlg.ShowDialog() == true)
            {
                string filename = dlg.FileName;
            }

One thought on “C# Open File Dialog

  1. Pingback: kursus online

Leave a Reply

Your email address will not be published. Required fields are marked *