CSharp examples for System.Windows.Forms:Dialog
Search Files with OpenFileDialog
using System.Windows.Forms; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*from ww w.j a va2s .c o m*/ public class Main{ public static List<string> SearchFiles() { List<string> filPath = new List<string>(); OpenFileDialog dialog = new OpenFileDialog(); dialog.Multiselect = true; dialog.DereferenceLinks = true; dialog.Filter = "All File(*.*)|*.*"; dialog.FilterIndex = 0; dialog.RestoreDirectory = false; if (dialog.ShowDialog() == DialogResult.OK) { filPath.AddRange(dialog.FileNames); } return filPath; } }