反射 自动设置 本对象所有属性 // 将其它对象属性 复制到本对象中 public void SetParam(ParamObj aParam) { // 获取本对象属性 PropertyInfo[] properties = this.GetType().GetProperties(); foreach (PropertyInfo property in properties) { // 设置本对象 property.SetValue(this, property.GetValue(aParam)); } }