Share via


OSFeature.Feature Özellik

Tanım

Özellik sorguları için kullanılacak sınıfın OSFeature bir static örneğini alır. Bu özellik salt okunur durumdadır.

public:
 static property System::Windows::Forms::OSFeature ^ Feature { System::Windows::Forms::OSFeature ^ get(); };
public static System.Windows.Forms.OSFeature Feature { get; }
static member Feature : System.Windows.Forms.OSFeature
Public Shared ReadOnly Property Feature As OSFeature

Özellik Değeri

OSFeature sınıfının örneği.

Örnekler

Aşağıdaki örnek, özelliği sorgular OSFeatureLayeredWindows . Sürüm, özelliğin mevcut olup olmadığını belirlemek için olup olmadığını görmek nulliçin denetlendi. Sonuç bir metin kutusunda görüntülenir. Bu kod, oluşturulduğunu ve bir forma yerleştirildiğini varsayar 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

Açıklamalar

İşletim sistemi özelliklerini sorgulamak için bu static özelliği kullanın. Bu sınıfın bir örneğini oluşturamazsınız.

Bir özelliğin sürümünü belirlemek için yöntemini çağırın GetVersionPresent . Bir özelliğin veya belirli bir sürümün mevcut olup olmadığını belirlemek için yöntemini çağırın IsPresent ve bu sınıfta sağlanan özellik tanımlayıcılarıyla aranacak özelliği belirtin.

Şunlara uygulanır

Ayrıca bkz.