C# リフクレクションサンプル

public class Person
{
    public string Name { get; set; }
    public int Age { get; set; }
}

static void Main(string[] args)
{
    Person person = new Person { Name = "sato", Age = 20 };
    Object obj = person;
    Type objType = obj.GetType();
    var name = objType.GetProperty("Name");
    var age = objType.GetProperty("Age");
    WriteLine(name.GetValue(obj));
    WriteLine(age.GetValue(obj));
}
> sato
> 20