private string[] GetOldFilePath() { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "c:\\"; openFileDialog1.Filter = "TXT|*.txt"; openFileDialog1.Multiselect = true; // openFileDialog1.FilterIndex = 2; openFileDialog1.RestoreDirectory = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK) { string file = openFileDialog1.SafeFileName;
foreach(string fileName in openFileDialog1.FileNames) { textBox1.Text += fileName + Environment.NewLine; } Files = openFileDialog1.FileNames; // it gets only the selected files
string FolderPath = ???????????????? // is it possible to save here the path so that I can assign this value to the global oldPath variable. This way I will use it later by pass it as a parameter to other function. What to write to get the path of folder which contains the files? } return Files; }