다음을 통해 공유


HttpContext.Server 속성

정의

HttpServerUtility 웹 요청을 처리하는 데 사용되는 메서드를 제공하는 개체를 가져옵니다.

public:
 property System::Web::HttpServerUtility ^ Server { System::Web::HttpServerUtility ^ get(); };
public System.Web.HttpServerUtility Server { get; }
member this.Server : System.Web.HttpServerUtility
Public ReadOnly Property Server As HttpServerUtility

속성 값

HttpServerUtility 현재 HTTP 요청에 대한 것입니다.

설명

이 속성은 Server 클래스의 HttpServerUtility 속성 및 메서드에 프로그래밍 방식으로 액세스할 수 있도록 합니다. ASP.NET 페이지에는 네임스페이스(클래스 포함)에 대한 기본 참조 System.Web 가 포함되어 HttpContext 있으므로 정규화된 클래스 참조를 사용하지 않고도 .aspx 페이지의 멤버 HttpContext 를 참조할 HttpContext수 있습니다. 예를 들어 서버에서 COM 개체의 인스턴스를 만드는 데 사용할 Server.CreateObject("MyCOMComponent") 수 있습니다. 그러나 ASP.NET 코드 숨김 모듈의 멤버를 사용하려면 모듈의 HttpServerUtility 네임스페이스에 대한 참조 System.Web 와 현재 활성 요청/응답 컨텍스트와 사용하려는 클래스 모두에 System.Web 대한 정규화된 참조를 포함해야 합니다. 예를 들어 코드 숨김 페이지에서 정규화된 이름을 HttpContext.Current.Server.CreateObject("MyCOMComponent")지정해야 합니다.

적용 대상