내가 뭘 잘못하고 있는지 알 수 없습니다. 나는이 코드를 가지고있다 :C# 반사가 Point 클래스에서 작동하지 않습니까?
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)
왜?
나는 대답을 찾고 있었지만 나는 아무것도 찾지 못했습니다.
. 대단히 고마워. – user3820501