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- 如果不存在型別 serviceType 的服務物件,則為 nullnull if there is no service object of type serviceType.

適用於