主頁 > 知識(shí)庫(kù) > Json數(shù)據(jù)轉(zhuǎn)換list對(duì)象實(shí)現(xiàn)思路及代碼

Json數(shù)據(jù)轉(zhuǎn)換list對(duì)象實(shí)現(xiàn)思路及代碼

熱門標(biāo)簽:內(nèi)蒙古智能電銷機(jī)器人哪家強(qiáng) 杭州智能電話機(jī)器人 百度地圖標(biāo)注點(diǎn)擊事件 地圖標(biāo)注位置多的錢 廈門四川外呼系統(tǒng) 山東防封電銷卡辦理套餐 濟(jì)源人工智能電話機(jī)器人價(jià)格 怎樣在地圖標(biāo)注消火栓圖形 泰州手機(jī)外呼系統(tǒng)軟件
JSON代碼
復(fù)制代碼 代碼如下:

[{"cId":2,"cName":"\u767d\u841d\u535c","amount":26,"price":"17"},{"cId":3,"cName":"\u80e1\u841d\u535c","amount":21,"price":"21"},{"cId":4,"cName":"\u7389\u7c73","amount":7,"price":"23"},{"cId":14,"cName":"\u897f\u74dc","amount":7,"price":"29"},{"cId":5,"cName":"\u571f\u8c46","amount":3,"price":"24"},{"cId":1,"cName":"\u8349\u8393","amount":427,"price":"27"},{"cId":10,"cName":"\u5357\u74dc","amount":303,"price":"30"},{"cId":11,"cName":"\u82f9\u679c","amount":1,"price":"24"},{"cId":23,"cName":"\u77f3\u69b4","amount":4,"price":"54"},{"cId":18,"cName":"\u6843\u5b50","amount":3,"price":"40"},{"cId":15,"cName":"\u9999\u8549","amount":9,"price":"32"},{"cId":13,"cName":"\u8461\u8404","amount":7,"price":"47"},{"cId":26,"cName":"\u67da\u5b50","amount":1,"price":"58"},{"cId":27,"cName":"\u83e0\u841d","amount":5,"price":"62"},{"cId":19,"cName":"\u6a59\u5b50","amount":27,"price":"41"}]

VS2008
引用System.ServiceModel.Web.dll
引用System.Runtime.Serialization.dll
復(fù)制代碼 代碼如下:

private void Form1_Load(object sender, EventArgs e)
{
string _JsonText = System.IO.File.ReadAllText(@"C:\2.TXT");
ListTest> _Test = new ListTest>();
DataContractJsonSerializer _Json = new DataContractJsonSerializer(_Test.GetType());
byte[] _Using = System.Text.Encoding.UTF8.GetBytes(_JsonText);
System.IO.MemoryStream _MemoryStream = new System.IO.MemoryStream(_Using);
_MemoryStream.Position = 0;
_Test =(ListTest>)_Json.ReadObject(_MemoryStream);
}
public class Test
{
public int cId = 0;
public string cName = "";
public int amount = 0;
public string price = "";
}
您可能感興趣的文章:
  • Java JSON轉(zhuǎn)成List結(jié)構(gòu)數(shù)據(jù)
  • python使用zip將list轉(zhuǎn)為json的方法
  • Json字符串與Object、List、Map的互轉(zhuǎn)工具類
  • JSON--List集合轉(zhuǎn)換成JSON對(duì)象詳解
  • 將List對(duì)象列表轉(zhuǎn)換成JSON格式的類實(shí)現(xiàn)方法
  • 將Java的List結(jié)構(gòu)通過GSON庫(kù)轉(zhuǎn)換為JSON的方法示例
  • JSON的String字符串與Java的List列表對(duì)象的相互轉(zhuǎn)換
  • Json轉(zhuǎn)list二層解析轉(zhuǎn)換代碼實(shí)例

標(biāo)簽:洛陽 朔州 喀什 百色 朝陽 新鄉(xiāng) 臺(tái)州 周口

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Json數(shù)據(jù)轉(zhuǎn)換list對(duì)象實(shí)現(xiàn)思路及代碼》,本文關(guān)鍵詞  Json,數(shù)據(jù),轉(zhuǎn)換,list,對(duì)象,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Json數(shù)據(jù)轉(zhuǎn)換list對(duì)象實(shí)現(xiàn)思路及代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于Json數(shù)據(jù)轉(zhuǎn)換list對(duì)象實(shí)現(xiàn)思路及代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章