HttpRequest.PhysicalPath 속성

정의

요청된 URL에 해당하는 실제 파일 시스템 경로를 가져옵니다.

public:
 property System::String ^ PhysicalPath { System::String ^ get(); };
public string PhysicalPath { get; }
member this.PhysicalPath : string
Public ReadOnly Property PhysicalPath As String

속성 값

String

현재 요청의 파일 시스템 경로입니다.

예제

다음 코드 예제에서는 메서드를 HtmlEncode 사용하여 속성 값 PhysicalPathWriteLine 메서드를 HTML로 인코딩하여 인코딩된 값을 파일에 씁니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 HttpRequest 클래스입니다.

// Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.PhysicalApplicationPath));
sw.WriteLine(Server.HtmlEncode(Request.PhysicalPath));
sw.WriteLine(Server.HtmlEncode(Request.RawUrl));
' Write request information to the file with HTML encoding.
sw.WriteLine(Server.HtmlEncode(Request.PhysicalApplicationPath))
sw.WriteLine(Server.HtmlEncode(Request.PhysicalPath))
sw.WriteLine(Server.HtmlEncode(Request.RawUrl))

설명

사용 ExecuteTransfer리디렉션 시나리오에서 속성은 PhysicalPath 원래 페이지의 경로를 반환합니다. 현재 실행 중인 페이지의 실제 경로를 찾으려면 입력 인수가 MapPath 속성으로 설정된 메서드를 CurrentExecutionFilePath 사용합니다.

적용 대상

추가 정보