WmiConfigurationAttribute.HostingModel 屬性

定義

取得或設定 WMI 提供者的裝載模型。

public:
 property System::Management::Instrumentation::ManagementHostingModel HostingModel { System::Management::Instrumentation::ManagementHostingModel get(); void set(System::Management::Instrumentation::ManagementHostingModel value); };
public System.Management.Instrumentation.ManagementHostingModel HostingModel { get; set; }
member this.HostingModel : System.Management.Instrumentation.ManagementHostingModel with get, set
Public Property HostingModel As ManagementHostingModel

屬性值

ManagementHostingModel 值,表示 WMI 提供者的裝載模型。

範例

在下列範例中, WmiConfigurationAttribute 會用來指出它所包含的元件會實作透過 root\NVPair 命名空間公開的提供者。 因為裝載模型不是 Decoupled,所以它是進程內提供者。 值 NetworkService 表示進程內提供者會在 NetworkService 安全性內容下執行。

[assembly: WmiConfiguration("root\\NVPair", HostingModel = ManagementHostingModel.NetworkService)]

在下一個範例中, WmiConfigurationAttribute 會用來指出它所包含的元件會實作透過 root\NVPair 命名空間公開的提供者。 值 Decoupled 表示它是分離的提供者。

[assembly: WmiConfiguration("root\\NVPair", HostingModel = ManagementHostingModel.Decoupled)]

備註

WMI 提供者可由應用程式或 WMI 服務裝載。 應用程式所裝載的 WMI 提供者稱為分離提供者。 WMI 服務所裝載的這些服務稱為進程內提供者。 裝載模型值會決定裝載模型,而且在進程提供者的情況下,帳戶 (安全性內容) 執行。 如需 HostingModel 可能值的詳細資訊,請參閱 ManagementHostingModel

若要深入瞭解裝載模型,請參閱 MSDN 上的 WMI SDK 中的 提供者裝載和安全性 主題。

適用於