Using system;using system.collections.generic;using system.componentmodel;using system.data;using System.Drawing; Using system.text;using system.windows.forms;namespace testfolderbrowserdialog{public partial class Form1:form { Public Form1 () {InitializeComponent (); private void Btnfile_click (object sender, EventArgs e) {OpenFileDialog FileDialog = new Openfi Ledialog (); Filedialog.multiselect = true; Filedialog.title = "Please select File"; Filedialog.filter= "All Documents (*. *) |*.*"; if (filedialog.showdialog () = = DialogResult.OK) {string file=filedialog.filename; MessageBox.Show ("Selected file:" + file, "Select File Hint", messageboxbuttons.ok,messageboxicon.information); }} private void Btnpath_click (object sender, EventArgs e) {FolderBrowserDialog dialog = New FolderBrowserDialog (); Dialog. Description = "Please select file path"; if (dialog. ShowDialog () = = DialogResult.OK) {string foldpath = dialog. SelectedPath; MessageBox.Show ("Selected folder:" + Foldpath, "Select Folder Hint", MessageBoxButtons.OK, MessageBoxIcon.Information); }} private void Btnopen_click (object sender, EventArgs e) {System.Diagnostics.Process.St Art ("Explorer.exe", "c:\\windows"); } }}
C # code implementation open File folder and select File function