使用字符串值通过反射设置属性
stringShipLatitudedouble.
Ship ship = new Ship();string value = "5.5";PropertyInfo propertyInfo = ship.GetType().GetProperty("Latitude");
propertyInfo.SetValue(ship, value, null);ArgumentException:
不能将类型为“System.String”的对象转换为“System.Double”类型。
propertyInfo?
ABOUTYOU
芜湖不芜
随时随地看视频慕课网APP