亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

JSON 字典錯誤

JSON 字典錯誤

C#
qq_遁去的一_1 2021-10-09 16:54:25
我讀取了我的 json 文件并設置了一個字符串變量,我正在使用 System.Web.Script.Serialization;    FileStream fs = new FileStream(Server.MapPath("odul_en.json"),FileMode.Open,FileAccess.Read);    StreamReader sr = new StreamReader(fs);    string jsonGelen = sr.ReadToEnd();    var serializer = new JavaScriptSerializer();    var dict = serializer.Deserialize<Dictionary<string, object>>(jsonGelen);當我把斷點“var dict= serializer.Deserialize>(jsonGelen);” 行,我收到以下錯誤;System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken =b77a5c561934e089]]'odul_en.json 像這樣; [{"odulID": "130","Ad": "LaQ Creative Toy / Basic 001","Aciklama": "Instead of the gift product, the product is not paid for the price, can not be turned into money. There is no guarantee of the products because of collective purchase. Buying gift product is not returned. Photos are representative, products may vary."},{"odulID": "132","Ad": "Selfie Stick","Aciklama": "Instead of the gift product, the product is not paid for the price, can not be turned into money. There is no guarantee of the products because of collective purchase. Photos are representative, products may vary. Buying gift product is not returned. There is no color option. Suitable for Phones, easy to carry. The open length is 100 cm and the closed length is 23 cm"}]我搜索了解決方法;有人在json文件中說“刪除方括號”但沒有解決。(我的 .net 框架 3.5 不能使用動態)我該如何解決這個問題,謝謝。
查看完整描述

2 回答

  • 2 回答
  • 0 關注
  • 195 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號