![](/img/trans.png)
[英]How do I turn a C# object into a JSON string in .NET?
[英]How do I turn the json string to datatable?
我正在嘗試將Google的API響應json格式的字符串解析為datatable。
我嘗試using Newtonsoft.Json;
並這樣做:
var json = new WebClient().DownloadString(textBox1.Text);
DataTable tester = (DataTable)JsonConvert.DeserializeObject(json.ToString(), (typeof(DataTable)));
我收到此錯誤: Additional text found in JSON string after finishing deserializing object.
當我通過JSONLint運行字符串時,是說該字符串有效。
here is json:
http here is json:
//jsfiddle.net/q4XqQ/
我最終解析了json字符串並編寫了一些效果很好的正則表達式。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.