public string OpenSelectFiles() { FormShell formSelectFiles = new FormShell() { ShowInTaskbar = false, WindowState = FormWindowState.Minimized }; formSelectFiles.Show(); formSelectFiles.TopMost = true; OpenFileDialog openFileDialog = new OpenFileDialog(); //openFileDialog.Filter = "(*.jpg;*.bmp;*.png;*.gif;)|*.jpg;*.bmp;*.png;*.gif;|(*.pdf;*.doc;*.docx;*.txt;)|*.pdf;*.doc;*.docx;*.txt;|(*.wav;*.mp3;*.avi;)|*.wav;*.mp3;*.avi;|(*.dcm )|*.dcm"; openFileDialog.Filter = "(*.jpg;*.bmp;*.png;*.gif;*.pdf;*.doc;*.docx;*.txt;*.wav;*.mp3;*.avi;*.dcm)|*.jpg;*.bmp;*.png;*.gif;*.pdf;*.doc;*.docx;*.txt;*.wav;*.mp3;*.avi;*.dcm"; openFileDialog.FilterIndex = 0; openFileDialog.Multiselect = true; if (openFileDialog.ShowDialog(formSelectFiles) == DialogResult.OK) { formSelectFiles.Close(); return(string.Join(",", openFileDialog.FileNames)); } formSelectFiles.Close(); return(""); }
public string OpenSelectFolder() { FormShell formSelectFiles = new FormShell() { ShowInTaskbar = false, WindowState = FormWindowState.Minimized }; formSelectFiles.Show(); formSelectFiles.TopMost = true; FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog(); if (folderBrowserDialog.ShowDialog(formSelectFiles) == DialogResult.OK) { formSelectFiles.Close(); return(string.Join(",", folderBrowserDialog.SelectedPath)); } formSelectFiles.Close(); return(""); }