我无法弄清楚我做错了什么.我有这个代码:
Point p = new Point();
//point is (0,0)
p.X = 50;
//point is (50,0)
PropertyInfo temp = p.GetType().GetProperty("X");
temp.SetValue(p, 100, null);
//and point is still (50,0)
MethodInfo tt = temp.GetSetMethod();
tt.Invoke(p, new object[] { 200 });
//still (50,0)
Run Code Online (Sandbox Code Playgroud)
为什么?
我在寻找答案,但我什么也没找到.