IServiceProvider.GetService(Type) 方法

定义

获取指定类型的服务对象。Gets the service object of the specified type.

public:
 System::Object ^ GetService(Type ^ serviceType);
public object GetService (Type serviceType);
abstract member GetService : Type -> obj
Public Function GetService (serviceType As Type) As Object

参数

serviceType
Type

指定要获取的服务对象类型的对象。An object that specifies the type of service object to get.

返回

serviceType 类型的服务对象。A service object of type serviceType.

- 或 --or- 如果没有类型为 null 的服务对象,则为 serviceTypenull if there is no service object of type serviceType.

适用于