using System.Collections.Generic;
public static void Main(string[] args)
Console.WriteLine("A.ble = \"" + a.GetPropValue("ble")+"\"");
Console.WriteLine("B.test = \"" + b.GetPropValue("test")+"\"");
public object GetPropValue(string propName)
System.Reflection.PropertyInfo info = t.GetProperty(propName);
return info.GetValue(this, null);
System.Reflection.FieldInfo info2 = t.GetField(propName);
return info2.GetValue(this);
public string ble = "A's property.";
public string test = "B's property.";