日期:2014-05-17 浏览次数:21056 次
class Program
{
static void Main(string[] args)
{
Test test = new Test();
test.CardNo = "877878";
object obj = test;
Type type = obj.GetType();
Console.WriteLine(type.GetProperty("CardNo").GetValue(obj, null));//获得obj对象的CardNo属性值 877878
}
}
public class Test
{
public string CardNo { get; set; }
}