Programming

[C#] OpenFileDialog.ShowDialog() 에서 멈춤 현상

벅스바니 2011. 10. 25. 16:36

아래의 소스에서 'AutoUpgradeEnabled'를 false로 하지 않으면,

네트웍 체크하느라 해당 Form의 기능이 정지 되어 버립니다.

OpenFileDialog ofd = new OpenFileDialog();
{
ofd.AutoUpgradeEnabled = false;
ofd.InitialDirectory = "C:\\";
ofd.RestoreDirectory = true;
ofd.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
ofd.FilterIndex = 0;
if (ofd.ShowDialog() == DialogResult.OK)
{
try
{
FileName.Text = ofd.FileName;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}