我正在尝试编写一些代码来设置结构的属性(重要的是它是结构的属性),但失败了:
System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle();
PropertyInfo propertyInfo = typeof(System.Drawing.Rectangle).GetProperty("Height");
propertyInfo.SetValue(rectangle, 5, null);
高度值(由调试器报告)永远不会设置为任何值-它保持默认值0。
之前我在课堂上做了很多思考,并且效果很好。另外,我知道在处理结构时
慕容708150
慕姐8265434
德玛西亚99
相关分类