zoukankan      html  css  js  c++  java
  • Newtonsoft.Json 方法使用()

    JSON.NET1.3.0,旧版本的json.net,使用Newtonsoft.Json.JavaScriptConvert.DeserializeObject类进行转换

    如果是版本的json.net,如JSON.NET 4.0,已经转移到Newtonsoft.Json.JsonConvert类下面,Newtonsoft.Json.JsonConvert.DeserializeObject。

    所以如果你找不到JavaScriptConvert类,那是你的版本的问题。

    SetCarrier sc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<SetCarrier>(data);
    SetCarrier sc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<SetCarrier>(data);
    ViewData["TaskBaseData"] = Newtonsoft.Json.JavaScriptConvert.SerializeObject(task);
    K_AssessTask model = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<K_AssessTask>(baseData);
    List<K_Bran_TiKu> items = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<List<K_Bran_TiKu>>(itemData);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(sdata);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(sdata);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(SearchInfo);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(SearchInfo);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList);
    SetCarrier sc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<SetCarrier>(data);
    SetCarrier sc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<SetCarrier>(data);
    RecordCarrier rc = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<RecordCarrier>(data);
    ViewData["TaskBaseData"] = Newtonsoft.Json.JavaScriptConvert.SerializeObject(task);
    K_AssessTask model = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<K_AssessTask>(baseData);
    List<K_TaskTiKu> items = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<List<K_TaskTiKu>>(itemData);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(SearchInfo);
    IList<K_UserAssessResultSubject> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<IList<K_UserAssessResultSubject>>(sdata);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(sdata);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(strList);
    ViewData["TaskBaseData"] = Newtonsoft.Json.JavaScriptConvert.SerializeObject(task);
    K_AssessTask model = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<K_AssessTask>(baseData);
    Dictionary<string, object> svalue = Newtonsoft.Json.JavaScriptConvert.DeserializeObject<Dictionary<string, object>>(SearchInfo);
  • 相关阅读:
    Random类
    类型转换
    一个简单的Web登录程序
    第一个Servlet程序
    使用MyEclipse开发 服务器的部署方式(续)
    MyEclipse配置
    Tomact问题
    Tomact配置
    HTTP基础:URL格式、 HTTP请求、响应、消息
    关闭二维码
  • 原文地址:https://www.cnblogs.com/wolfocme110/p/4703767.html
Copyright © 2011-2022 走看看