HttpContext.IServiceProvider.GetService(Type) 方法

定义

返回当前服务类型的对象。Returns an object for the current service type.

 virtual System::Object ^ System.IServiceProvider.GetService(Type ^ service) = IServiceProvider::GetService;
object IServiceProvider.GetService (Type service);
Function GetService (service As Type) As Object Implements IServiceProvider.GetService

参数

service
Type

要将服务提供商设置为的 HttpContext 服务类型。A type of HttpContext service to set the service provider to.

返回

如果找到服务,则为 HttpContext;否则为 nullA HttpContext; otherwise, null if no service is found.

实现

注解

此方法可用于获取对基础 HttpWorkerRequest 对象的访问权限。This method is useful to gain access to the underlying HttpWorkerRequest object.

适用于