共用方式為


類別SMS_Identification中的 GetProviderVersion 方法

GetProviderVersion Configuration Manager 中的 Windows Management Instrumentation (WMI) 類別方法會從 SMS 提供者 DLL 的版本資源取得產品版本字串。

下列語法是從受控物件格式 (MOF) 程式代碼中簡化,並定義方法。

語法

SInt32 GetProviderVersion(
      String VersionString
);

參數

VersionString 資料類型: String

限定符:[out]

來自 Smsprov.dll 檔案版本資源的產品版本字串。

傳回值

數據 SInt32 類型,為 0 表示成功或非零表示失敗。

如需處理傳回錯誤的相關信息,請參閱關於 Configuration Manager 錯誤

註解

這個方法所取得的版本可讓您的應用程式判斷SMS提供者是否已套用Hotfix。

範例程序代碼

下列範例示範如何呼叫這個方法來取得SMS提供者的版本號碼。

Dim Identification As SWbemObject
Dim ProviderVersion As String

Set Identification = GetObject("winmgmts:\root\sms\site_<sitecode>:SMS_Identification")
Identification.GetProviderVersion ProviderVersion

MsgBox "Version = " & ProviderVersion

需求

運行時間需求

如需詳細資訊,請參閱 Configuration Manager 伺服器運行時間需求。

開發需求

如需詳細資訊,請參閱 Configuration Manager 伺服器開發需求。

另請參閱

SMS_Identification伺服器 WMI 類別