的值
rectangle被装箱-但是您将丢失被修改的装箱值。尝试这个:
Rectangle rectangle = new Rectangle();PropertyInfo propertyInfo = typeof(Rectangle).GetProperty("Height");object boxed = rectangle;propertyInfo.SetValue(boxed, 5, null);rectangle = (Rectangle) boxed;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)