OSFeature.GetVersionPresent(Object) Метод

Определение

Извлекает версию указанной функции, которая в текущий момент доступна в операционной системе.

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, если функция не найдена.

Примеры

В следующем примере выполняется OSFeature запрос на эту функцию LayeredWindows . Проверяется версия, чтобы узнать, имеет ли она значение 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

Комментарии

Feature Используйте свойство , static экземпляр , предоставленный OSFeature в этом классе, для запроса номера версии компонента.

Применяется к

См. также раздел