public class test
{
private string str = "abc";
private int aa = 99;
}
test a = new test();
System.Reflection.FieldInfo _FieldIfno = a.GetType().GetField("str", System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Instance);
object _Value =_FieldIfno.GetValue(a);
MessageBox.Show(_Value.ToString());
使用反射取类中的私有字段!