파일 선택 다이얼로그 박스 열기입니다.
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);
}
}
}
}
'Programming' 카테고리의 다른 글
[C#] 프로그레스바 건드리기 (0) | 2011.10.27 |
---|---|
[C#] 시리얼 포트 사용하기 (0) | 2011.10.27 |
[C#] 타이머 사용하기 (0) | 2011.10.27 |
[C#] 다중 스레드에서 다른 스레드 억세스 에러 (0) | 2011.10.25 |
[C#] OpenFileDialog.ShowDialog() 에서 멈춤 현상 (1) | 2011.10.25 |