string fileName = openfiledialog.FileName;
string result_fileName = fileName.Substring(fileName.LastIndexOf("\\") + 1);
결과 : fileName : OpenFileDialog에서 가져온 파일의 전체 경로와 파일 이름을 가져 옴.
result_fileName : OpenFileDialog에서 가져온 파일의 이름만 저장.
'Development > C#' 카테고리의 다른 글
코드로 배포/설치프로그램 생성 후 명령프롬프트 명령 내리기 (0) | 2011.02.16 |
---|---|
Attribute 사용처 - 두번째 이야기 (0) | 2010.03.08 |
Attribute 사용처 (0) | 2010.03.08 |
다른 프로세스에서 사용 중인 파일 읽어오기. (2) | 2010.03.08 |
Binary 파일에서 문자열 읽어오는 방법 (0) | 2010.03.08 |