FileSystem.GetName(String) 메서드

정의

제공된 경로에서 파일 이름을 구문 분석합니다.

public:
 static System::String ^ GetName(System::String ^ path);
public static string GetName (string path);
static member GetName : string -> string
Public Shared Function GetName (path As String) As String

매개 변수

path
String

필수 요소. 구문 분석할 경로입니다. String.

반환

지정된 경로의 파일 이름입니다.

예제

다음 예제에서는 파일 경로를 구문 분석하고 파일의 이름을 반환합니다.

MsgBox("The filename is: " &
My.Computer.FileSystem.GetName("C:\testdirectory\testfile"))

경로를 C:\Testdirectory\Testfile 구문 분석하려는 경로로 바꿉니다.

설명

문자열 작업입니다. FileSystem 은 검사되지 않습니다.

메서드는 GetName 경로의 끝에서 발생하는 슬래시 표시를 무시합니다.

다음 표에서 관련 된 작업의 예로 My.Computer.FileSystem.GetFileName 메서드.

대상 참조 항목
파일 경로 구문 분석 방법: Visual Basic에서 파일 경로의 구문 분석

적용 대상