XP下在打开OpenFileDialog后,不能修改目录的名称,提示 "The action can't be completed because the folder is open in another program. Close the folder and try again."
解决方法:
var dlg = new OpenFileDialog;
dlg.RestoreDirectory = true;
if (dlg.ShowDialog(this) == DialogResult.OK)
{
try
{Stream fileStream = dlg.OpenFile();
fileStream.Close();
}
catch {}
}