Try this:
OpenFileDialog choofdlog = new OpenFileDialog();
choofdlog.Filter = "All Files (*.DAT)|*.DAT";
choofdlog.FilterIndex = 1;
choofdlog.Multiselect = true;
if (choofdlog.ShowDialog() == DialogResult.OK)
{
foreach (string sFileName = choofdlog.FileNames)
{
using (FileStream fs = new FileStream(sFileName, FileMode.Open, FileAccess.Read))
{
{
...
}
}
}
When you use multiselect, you should work from the FileNames collection, not a single FileName - and you shouldn't be trying to open files if the user presses "Cancel" in the dialog.