当前位置:网站首页>C#将对象转换为Dictionary字典集合
C#将对象转换为Dictionary字典集合
2022-08-04 19:44:00 【幕尘枫】
/// <summary>
/// 将对象转换为字典集合
/// </summary>
/// <param name="zone">对象</param>
/// <returns></returns>
public Dictionary<string, string> ObjectToMap(Zone zone)
{
Dictionary<string, string> map = new Dictionary<string, string>();
PropertyInfo[] list = zone.GetType().GetProperties();
foreach (PropertyInfo p in list)
{
//Console.WriteLine("键:" + p.Name + ",值:" + p.GetValue(zone, null));
map.Add(p.Name, p.GetValue(zone, null).ToString());
}
return map;
}边栏推荐
- 电脑一键重装系统后连不上远程了?教你设置的方法
- Orthodontic MIA micro-implant anchorage technology China 10th anniversary exchange meeting was held in Shenyang
- Differences in the working mechanism between SAP E-commerce Cloud Accelerator and Spartacus UI
- 入门:人脸专集1 | 级联卷积神经网络用于人脸检测(文末福利)
- awk 统计平均 最大 最小值
- 密码学系列之:PEM和PKCS7,PKCS8,PKCS12
- QT 小知识随记
- Go学习笔记(篇一)配置Go开发环境
- 存储资源盘活系统助力新基建
- 「 WAIC 2022 · 黑客马拉松」蚂蚁财富两大赛题邀你来战!
猜你喜欢

污损指纹恢复与识别

入门:人脸专集1 | 级联卷积神经网络用于人脸检测(文末福利)

Pedestrian fall detection experiment based on YOLOV5

seata源码解析:seata server各种消息处理流程

PG网络传输安全SSL介绍及使用示例

Seata source code analysis: various message processing processes of seata server

Defaced Fingerprint Recovery and Identification

In July 2022, domestic database memorabilia

The book "The Essence of Alipay Experience Design", a record of knowledge related to testing

Orthodontic MIA micro-implant anchorage technology China 10th anniversary exchange meeting was held in Shenyang
随机推荐
03 ts类型缩小,函数
工业相机CCD与CMOS
华为交换机:STP测试实验
「 WAIC 2022 · 黑客马拉松」蚂蚁财富两大赛题邀你来战!
Dragoma(DMA)元宇宙系统开发
如何手动下载并安装 Visual Studio Code 的 SAP Fiori tools - Extension Pack
红外图像滤波
拥抱Cmake小朋友 简单又实用,但是不灵活
完善的交叉编译环境记录 peta 生成的shell 脚本
基于YOLOV5行人跌倒检测实验
NLP技术为何在工业界这么卷?前沿案例解析来了
SQL Server 遇到报错解决办法--更新中
A complete cross-compilation environment records the shell scripts generated by peta
QT 小知识随记
SAP 电商云 Accelerator 和 Spartacus UI 的工作机制差异
使用.NET简单实现一个Redis的高性能克隆版(二)
To -.-- -..- -
nr part calculation
[Latest Information] 2 new regions will announce the registration time for the soft exam in the second half of 2022
Aura clock chip generation configuration file script