日期:2014-05-17  浏览次数:20718 次

.net如何读取json数据
[{"TaskRoleSpaces":"","TaskRoles":"","ProxyUserID":"5d9ad5dc1c5e494db1d1b4d8d79b60a7","UserID":"5d9ad5dc1c5e494db1d1b4d8d79b60a7","UserName":"姓名","UserSystemName":"2234","OperationName":"送合同负责人","OperationValue":"同意","OperationValueText":"","SignDate":"2013-06-19 10:31:26","Comment":"同意","FormDataHashCode":"","SignatureDivID":""},{"TaskRoleSpaces":"","TaskRoles":"","ProxyUserID":"2c96c3943826ea93013826eafe6d0089","UserID":"2c96c3943826ea93013826eafe6d0089","UserName":"姓名2","UserSystemName":"1234","OperationName":"送合同负责人","OperationValue":"同意","OperationValueText":"","SignDate":"2013-06-20 09:37:11","Comment":"同意","FormDataHashCode":"","SignatureDivID":""}]

这个是存放到数据库的一个字段中,放到一个string里后,如何得到像“UserName”或“UserID”的值

------解决方案--------------------
c# 解析JSON的几种办法 
------解决方案--------------------
JobInfo实体类:
public class JobInfo
    {
        public string TaskRoleSpaces { get; set; }
        public string TaskRoles { get; set; }
        public string ProxyUserID { get; set; }
        public string UserID { get; set; }
        public string UserName { get; set; }
        public string UserSystemName { get; set; }
        public string OperationName { get; set; }
        public string OperationValue { get; set; }
        public string OperationValueText { get; set; }
        public DateTime SignDate { get; set; }
        public string Comment { get; set; }
        public string FormDataHashCode { get; set; }