Udostępnij przez


OSFeature.Feature Właściwość

Definicja

static Pobiera wystąpienie OSFeature klasy do użycia dla zapytań funkcji. Ta właściwość jest tylko do odczytu.

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

Wartość właściwości

Wystąpienie klasy OSFeature.

Przykłady

Poniższy przykład wykonuje zapytania OSFeature dotyczące LayeredWindows funkcji. Wersja jest sprawdzana, czy jest nullto , aby określić, czy funkcja jest obecna. Wynik jest wyświetlany w polu tekstowym. Ten kod zakłada, że textBox1 został utworzony i umieszczony w formularzu.

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

Uwagi

static Ta właściwość służy do wykonywania zapytań dotyczących funkcji systemu operacyjnego. Nie można utworzyć wystąpienia tej klasy.

Aby określić wersję funkcji, wywołaj metodę GetVersionPresent . Aby określić, czy istnieje funkcja lub określona wersja, wywołaj IsPresent metodę i określ funkcję, aby wyszukać identyfikatory funkcji podane w tej klasie.

Dotyczy

Zobacz też