使用 dynamic 标记解析JSON字符串(转)

林烨华
2023-12-01

http://www.cnblogs.com/taotaodetuer/p/4171327.html

 

string jsonStr = "{\"data\": {\"ssoToken\": \"70abd3d8a6654ff189c482fc4842468c\",\"account\":\"admin\",\"userType\":\"platformAdmin\",\"realName\": \"超级管理员\",\"sex\": 0,\"sexName\":\"男\",\"email\":\"alina_dong@163.com\",\"mobile\":\"15120757948\",\"createdDt\": \"2013-08-16 00:00:00\",\"updatedDt\": \"2014-12-10 00:00:00\" },\"isSuccess\": true}"; 
 var loginInfo = JsonConvert.DeserializeObject<dynamic>(jsonStr); 
 var user = loginInfo.data;
 string ssoToken = user.ssoToken;
 string account = user.account;

 

转载于:https://www.cnblogs.com/wangjunwei/p/4173109.html

 类似资料: