Za foldere:
Code:
string WorkingDirectory = @"c:\windows\";
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.Description = "Choose working directory:";
dialog.SelectedPath = WorkingDirectory;
if(dialog.ShowDialog() == DialogResult.Cancel) return false;
WorkingDirectory = dialog.SelectedPath;
Za fajlove:
Code:
string WorkingDirectory = @"c:\windows\";
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "Xml files (*.xml)|*.xml";
dialog.InitialDirectory = WorkingDirectory;
dialog.FileName = "";
if(dialog.ShowDialog() == DialogResult.Cancel) return false;
string FileName = dialog.FileName;