System.Reflection.FieldInfo.IsPrivate Property

Gets a value indicating whether the field is private.

Syntax

public bool IsPrivate { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Private fields are accessible only from member functions.

The IsPrivate property is set when the FieldAttributes.Private attribute is set.

To get the IsPrivate property, first get the class Type. From the Type, get the FieldInfo. From the FieldInfo, get the IsPrivate property. To access a non-public field, set the BindingFlags to NonPublic, and either Static or Instance in the GetField method.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0