FileSystem.GetParentPath(String) 메서드

정의

제공된 경로의 부모 경로를 반환합니다.

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

매개 변수

path
String

검사할 경로입니다.

반환

제공된 경로의 부모 경로입니다.

예외

경로가 루트 경로이기 때문에 부모 경로를 포함하지 않은 경우

path이(가) Nothing인 경우

경로가 시스템 정의 최대 길이를 초과하는 경우

경로의 파일 이름이나 디렉터리 이름에 콜론(:)이 있거나 이름의 형식이 잘못된 경우

예제

이 예제에서는 의 부모 경로를 C:\Backups\Tmp\Test가져옵니다.

Dim strPath = My.Computer.FileSystem.GetParentPath("C:\backups\tmp\test")
MsgBox(strPath)

설명

문자열 작업입니다. 파일 시스템을 검사하지 않습니다.

적용 대상