OSFeature.GetVersionPresent(Object) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
システムで現在使用可能な指定された機能のバージョンを取得します。
public:
override Version ^ GetVersionPresent(System::Object ^ feature);
public override Version GetVersionPresent(object feature);
public override Version? GetVersionPresent(object feature);
override this.GetVersionPresent : obj -> Version
Public Overrides Function GetVersionPresent (feature As Object) As Version
パラメーター
- feature
- Object
バージョンが要求された機能 ( LayeredWindows または Themes)。
戻り値
現在システムで使用できる指定されたオペレーティング システム機能のバージョンを表す Version 。機能が見つからない場合は null 。
例
次の例では、LayeredWindows機能のOSFeatureクエリを実行します。 バージョンは、機能が存在するかどうかを判断するために、 nullされているかどうかを確認するためにチェックされます。 結果がテキスト ボックスに表示されます。 このコードは、 textBox1 が作成され、フォームに配置されていることを前提としています。
private:
void LayeredWindows()
{
// Gets the version of the layered windows feature.
Version^ myVersion = OSFeature::Feature->GetVersionPresent(
OSFeature::LayeredWindows );
// Prints whether the feature is available.
if ( myVersion != nullptr )
{
textBox1->Text = "Layered windows feature is installed.\n";
}
else
{
textBox1->Text = "Layered windows feature is not installed.\n";
}
}
private void LayeredWindows() {
// Gets the version of the layered windows feature.
Version myVersion =
OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows);
// Prints whether the feature is available.
if (myVersion != null)
textBox1.Text = "Layered windows feature is installed.\n";
else
textBox1.Text = "Layered windows feature is not installed.\n";
}
Private Sub LayeredWindows()
' Gets the version of the layered windows feature.
Dim myVersion As Version = _
OSFeature.Feature.GetVersionPresent(OSFeature.LayeredWindows)
' Prints whether the feature is available.
If (myVersion IsNot Nothing) Then
textBox1.Text = "Layered windows feature is installed." & _
ControlChars.CrLf
Else
textBox1.Text = "Layered windows feature is not installed." & _
ControlChars.CrLf
End If
End Sub
注釈
このクラスで提供されるOSFeatureのstatic インスタンスである Feature プロパティを使用して、機能のバージョン番号を照会します。