OSFeature.GetVersionPresent(Object) Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Načte verzi zadané funkce, která je aktuálně dostupná v systému.
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
Parametry
- feature
- Object
Funkce, jejíž verze je požadována, nebo LayeredWindowsThemes.
Návraty
Představuje Version verzi zadané funkce operačního systému, která je aktuálně dostupná v systému, nebo null pokud tuto funkci nelze najít.
Příklady
Následující příklad dotazů OSFeature na LayeredWindows funkci. Verze je kontrolována, aby se zjistilo, zda je null, aby bylo možné určit, zda je funkce přítomna. Výsledek se zobrazí v textovém poli. Tento kód předpokládá textBox1 , že byl vytvořen a umístěn ve formuláři.
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
Poznámky
Feature Pomocí vlastnosti, static instance OSFeature poskytnuté v této třídě, dotaz na číslo verze funkce.