protected void browse_folder_Click(object sender, EventArgs e) { Shell32.ShellClass shl = new Shell32.ShellClass(); Shell32.Folder2 fld = (Shell32.Folder2)shl.BrowseForFolder(0, "Select a directory", 0, System.Reflection.Missing.Value); if (fld != null) { text_path.Text = fld.Self.Path; } }
private void browseButton_Click(object sender, EventArgs e) { ShellClass shell; Folder2 folder; // Call the shell folder browsing dialog shell = new Shell32.ShellClass(); folder = (Folder2)shell.BrowseForFolder( 0, "Browse for Infantry Folder", 0, null ); if (folder != null) { browseTextBox.Text = folder.Self.Path; OptionsModified(); } }
private void selectLogFolder() { string strPath = ""; string strCaption = "Select a directory"; DialogResult result; ShellClass shell = new ShellClass(); Folder2 folder = (Folder2)shell.BrowseForFolder(0, strCaption, 0, System.Reflection.Missing.Value); if (folder == null) { result = DialogResult.Cancel; } else { strPath = folder.Self.Path; result = DialogResult.OK; } if (result == DialogResult.OK) { textBoxLogFilePath.Text = strPath; } }