title: In C# How to dynamically specify a member of a object, like obj["abc"] in PHP
body: <p>Say I have a class</p>
  
  <pre><code>public class Employee
  {
      public string name = "";
      public int age = 20;
  }
  </code></pre>
  
  <p>now I want a function that can dynamically get the value of a specified member of Employee</p>
  
  <pre><code>public class Util&lt;T&gt;
  {
      public static string GetValue(T obj, string member)
      {
          // how to write
      }
  }
  </code></pre>
  
  <p>so that I can use it like </p>
  
  <pre><code>Employee p1 = new Employee();
  string a = Util&lt;Employee&gt;.GetValue(p1, "age"); // a should be "20"
  </code></pre>
  
  <p>How to do it? like access member use obj["???"] in PHP</p>