2010-04-26 4 views
4

이것은 내가 파일의 디렉토리를 검색하도록 설정 한 코드입니다 :전체 경로를 반환하는 Directory.GetFiles, 파일 이름 만 필요합니까?

Dim fileArray() As String 
fileArray = Directory.GetFiles(System.AppDomain.CurrentDomain.BaseDirectory & "help\") 

그리고 성공적으로 디렉토리에있는 모든 파일을 얻을 수 있지만, aswell 절대 경로를 가져옵니다.

F:\Project\Project\bin\x86\Debug\help\book_troubleshoot.html 

그리고 나는 그것이 단지가되고 싶어요 : 예를 들어, fileArray()에있는 항목 중 하나입니다

book_troubleshoot.html 

오프 트림 모든 배열 항목을 통해 구문 분석을하지 않고 할 수있는 방법이 있나요 경로?

감사합니다.

답변

12
string filename= System.IO.Path.GetFileName(fullpathname); 
관련 문제