C # code to open a file folder and select a file,
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 OpenFileDialog (); fileDialog. multiselect = true; fileDialog. title = "select file"; fileDialog. filter = "all files (*. *) | *. * "; if (fileDialog. showDialog () = DialogResult. OK) {string file = fileDialog. fileName; MessageBox. show ("selected files:" + file, "SELECT file prompt", MessageBoxButtons. OK, MessageBoxIcon. information) ;}} private void btnPath_Click (object sender, EventArgs e) {FolderBrowserDialog dialog = new FolderBrowserDialog (); dialog. description = "select the file path"; if (dialog. showDialog () = DialogResult. OK) {string foldPath = dialog. selectedPath; MessageBox. show ("selected folder:" + foldPath, "select folder prompt", MessageBoxButtons. OK, MessageBoxIcon. information) ;}} private void btnOpen_Click (object sender, EventArgs e) {System. diagnostics. process. start ("assumer.exe", "c :\\ windows ");}}}