This documentation is archived and is not being maintained.

MemberInfo.MemberType Property

When overridden in a derived class, gets a MemberTypes value indicating the type of the member — method, constructor, event, and so on.

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

virtual property MemberTypes MemberType {
	MemberTypes get () abstract;
/** @property */
public abstract MemberTypes get_MemberType ()

public abstract function get MemberType () : MemberTypes

Property Value

A MemberTypes value indicating the type of member.

This property is overridden in derived classes, and the override returns the appropriate member type. Therefore, when you examine a set of MemberInfo objects — for example, the array returned by GetMembers — the MemberType property can be used to determine the member type of any given member.

To get the MemberType property, get the class Type. From the Type, get the MethodInfo array. From the MethodInfo array, get the MemberTypes.

The following example displays the member name and type of a specified class.

using namespace System;
using namespace System::Reflection;
int main()
   Console::WriteLine( "\nReflection.MemberInfo" );
   // Get the Type and MemberInfo.
   Type^ MyType = Type::GetType( "System.Reflection.PropertyInfo" );
   array<MemberInfo^>^Mymemberinfoarray = MyType->GetMembers();
   // Get the MemberType method and display the elements.
   Console::Write( "\nThere are {0} members in ", Mymemberinfoarray->GetLength( 0 ) );
   Console::Write( "{0}.", MyType->FullName );
   for ( int counter = 0; counter < Mymemberinfoarray->Length; counter++ )
      Console::Write( "\n{0}. {1} Member type - {2}", counter, Mymemberinfoarray[ counter ]->Name, Mymemberinfoarray[ counter ]->MemberType );

   return 0;

import System.*;
import System.Reflection.*;

class MyMemberInfo
    public static void main(String[] args)

        // Get the Type and MemberInfo.
        Type myType = Type.GetType("System.Reflection.PropertyInfo");
        MemberInfo myMemberInfoArray[] = myType.GetMembers();

        // Get the MemberType method and display the elements.
        Console.Write("\nThere are {0} members in ",
        Console.Write("{0}.", myType.get_FullName());

        for (int counter=0; counter < myMemberInfoArray.length; counter++) {
            Console.Write(("\n" + counter + ". " 
                + myMemberInfoArray[counter].get_Name() + " Member type - "
                + myMemberInfoArray[counter].get_MemberType().toString()));
    } //main
} //MyMemberInfo

import System;
import System.Reflection;
 class Mymemberinfo
    public static function Main() : void
       Console.WriteLine ("\nReflection.MemberInfo");
       //Get the Type and MemberInfo.
       var MyType : Type = Type.GetType("System.Reflection.PropertyInfo");
       var Mymemberinfoarray : MemberInfo[] = MyType.GetMembers();
       //Get the MemberType method and display the elements.
       Console.Write("\nThere are {0} members in ",
       Console.Write("{0}.", MyType.FullName);
       for (var counter : int in Mymemberinfoarray)
          Console.Write("\n" + counter + ". " 
             + Mymemberinfoarray[counter].Name
             + " Member type - " +

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0