using System;
using System.Reflection;
using System.IO;
[DefaultMemberAttribute("Age")]
public class MyClass
{
public void Name(String s) {}
public int Age
{
get
{
return 20;
}
}
public static void Main()
{
Type myType = typeof(MyClass);
MemberInfo[] memberInfoArray = myType.GetDefaultMembers();
if (memberInfoArray.Length > 0)
{
foreach(MemberInfo memberInfoObj in memberInfoArray)
{
Console.WriteLine("The default member name is: " + memberInfoObj.ToString());
}
}
}
}