HttpContext.Server Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the HttpServerUtility object that provides methods used in processing Web requests.
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
Property Value
The HttpServerUtility for the current HTTP request.
Remarks
The Server property provides programmatic access to the properties and methods of the HttpServerUtility class. Because ASP.NET pages contain a default reference to the System.Web namespace (which contains the HttpContext class), you can reference the members of HttpContext on an .aspx page without using the fully qualified class reference to HttpContext. For example, you can use Server.CreateObject("MyCOMComponent")
to create an instance of a COM object on the server. However, if you want to use the members of HttpServerUtility from an ASP.NET code-behind module, you must include a reference to the System.Web namespace in the module and a fully qualified reference to both the currently active request/response context and the class in System.Web that you want to use. For example, in a code-behind page you must specify the fully qualified name HttpContext.Current.Server.CreateObject("MyCOMComponent")
.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기