0
点赞
收藏
分享

微信扫一扫

tensorflow环境安装配置

棒锤_45f2 2024-01-09 阅读 21

创建实例

当构造方法被私有化

Setting copy = 
(Setting)FormatterServices.GetUninitializedObject(dbSetting.GetType());

常规手法

 var copy = Activator.CreateInstance(typeof(Setting)) ;

修改属性

Type type = typeof(Setting);
type.GetProperty("Name").SetValue(copy, sourceSetting.Name);
举报

相关推荐

0 条评论