VirtualPathUtility.MakeRelative(String, String) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
루트 연산자(타일드 [~])가 포함된 한 가상 경로에서 다른 가상 경로로의 상대 가상 경로를 반환합니다.
public:
static System::String ^ MakeRelative(System::String ^ fromPath, System::String ^ toPath);
public static string MakeRelative(string fromPath, string toPath);
static member MakeRelative : string * string -> string
Public Shared Function MakeRelative (fromPath As String, toPath As String) As String
매개 변수
- fromPath
- String
상대 가상 경로를 반환할 시작 가상 경로입니다.
- toPath
- String
상대 가상 경로를 반환할 끝 가상 경로입니다.
반품
에 대한 상대 가상 경로 fromPath 입니다 toPath.
예외
설명
fromPath 및 toPath 매개 변수가 루팅되지 않은 경우, 즉 루트 연산자(타일드 [~])와 같지 않거나, 타일 및 슬래시 표시(~/) 또는 타일과 이중 백슬래시(~/)와 같은 타일드(~)로 시작하지 않거나 슬래시 표시(/)ArgumentException로 시작하지 마세요.
URI에 사용되는 쿼리 문자열 매개 변수 및 HTML 앵커는 상대 경로를 결정하는 데 사용되지 않습니다.
is와 fromPath is "/directory1/file1.aspx"toPath이면 "/directory2/file2.aspx" 메서드가 MakeRelative 반환됩니다"../directory2/file2.aspx".