- ///
- /// 将对象转换为字典集合
- ///
- /// 对象
- ///
- 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;
- }