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

적용 대상