OpenFileDialog reads only the first file
问题 I'm using the following code to open multiple XML files and read the contents of the files but it doesn't work. OpenFD.Filter = "XML Files (*.xml)|*.xml"; OpenFD.Multiselect = true; if (OpenFD.ShowDialog() == DialogResult.OK) { foreach (string file in OpenFD.FileNames) { MessageBox.Show(file); System.IO.Stream fileStream = OpenFD.OpenFile(); System.IO.StreamReader streamReader = new System.IO.StreamReader(fileStream); using (streamReader) { MessageBox.Show(streamReader.ReadToEnd()); }