2010년 5월 1일, 2막
[C#] OpenFileDialog에서 경로 가지고 오기 본문
출처 : http://www.hoons.net/board/qacshap/content/17840
private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
OpenFileDialog dlg = openFileDialog1;
string fullPathName = dlg.FileName;
string fileName = dlg.SafeFileName;
string pathName = fullName.Substring(0, (fullPathName.Length - fileName.Length));
textBox1.Text = fullPathName; // 전체경로와파일명과확장자
textBox2.Text = fileName; // 파일명과확장자
textBox3.Text = pathName; // 전체경로
}
'Computer' 카테고리의 다른 글
| [C#] 로그인 처리 하기 (0) | 2013.04.09 |
|---|---|
| [C#] 파일명과 확장자 추출 예제 (0) | 2013.04.03 |
| [C#] 상속받은 Form의 버튼을 수정하고자 할 때 (0) | 2013.04.02 |
| [DevExpress] How to remove "Drag a column header here to group by that column" (0) | 2013.04.02 |
| [C#] OpenXML을 이용하여 Excel 파일의 빈 칸 읽기 (0) | 2013.03.29 |