Dieser Artikel wurde maschinell übersetzt. Wenn Sie die englische Version des Artikels anzeigen möchten, aktivieren Sie das Kontrollkästchen Englisch. Sie können den englischen Text auch in einem Popupfenster anzeigen, indem Sie den Mauszeiger über den Text bewegen.

Type.GetProperties-Methode: ()


Veröffentlicht: Oktober 2016

Gibt sämtliche öffentlichen Eigenschaften des aktuellen Type zurück.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

public PropertyInfo[] GetProperties()


Type: System.Reflection.PropertyInfo[]

Ein Array von PropertyInfo-Objekten, die alle öffentlichen Eigenschaften des aktuellen Type darstellen.

- oder -

Ein leeres Array vom PropertyInfo-Typ, wenn der aktuelle Type keine öffentlichen Eigenschaften besitzt.

Calling this overload is equivalent to calling the M:System.Type.GetProperties(System.Reflection.BindingFlags) overload with a bindingAttr argument equal to BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public in C# and BindingFlags.Instance Or BindingFlags.Static Or BindingFlags.Public in Visual Basic. It returns all public instance and static properties, both those defined by the type represented by the current T:System.Type object as well as those inherited from its base types.

A property is considered public to reflection if it has at least one accessor that is public. Otherwise the property is considered private, and you must use F:System.Reflection.BindingFlags.NonPublic | F:System.Reflection.BindingFlags.Instance | F:System.Reflection.BindingFlags.Static (in Visual Basic, combine the values using Or) to get it.

The M:System.Type.GetProperties method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies.

The following table shows what members of a base class are returned by the Get methods when reflecting on a type.

Member Type








Yes. A field is always hide-by-name-and-signature.


Not applicable

The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.



Yes. A method (both virtual and non-virtual) can be hide-by-name or hide-by-name-and-signature.

Nested Type




Not applicable

The common type system rule is that the inheritance is the same as that of the methods that implement the property. Reflection treats properties as hide-by-name-and-signature. See note 2 below.

  1. Hide-by-name-and-signature considers all of the parts of the signature, including custom modifiers, return types, parameter types, sentinels, and unmanaged calling conventions. This is a binary comparison.

  2. For reflection, properties and events are hide-by-name-and-signature. If you have a property with both a get and a set accessor in the base class, but the derived class has only a get accessor, the derived class property hides the base class property, and you will not be able to access the setter on the base class.

  3. Custom attributes are not part of the common type system.

If the current T:System.Type represents a constructed generic type, this method returns the T:System.Reflection.PropertyInfo objects with the type parameters replaced by the appropriate type arguments.

If the current T:System.Type represents a type parameter in the definition of a generic type or generic method, this method searches the properties of the class constraint.

The following example demonstrates the use of the GetProperties method.

PropertyInfo[] myPropertyInfo;
// Get the properties of 'Type' class object.
myPropertyInfo = Type.GetType("System.Type").GetProperties();
Console.WriteLine("Properties of System.Type are:");
for (int i = 0; i < myPropertyInfo.Length; i++)

.NET Framework
Verfügbar seit 1.1
Portierbare Klassenbibliothek
Unterstützt in: portierbare .NET-Plattformen
Verfügbar seit 2.0
Windows Phone Silverlight
Verfügbar seit 7.0
Zurück zum Anfang