파일 선택 다이얼로그 박스 열기입니다.

private void Browse_Click(object sender, EventArgs e)
{
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);
}
}
}
}

Posted by 벅스바니
,