大家好,欢迎来到IT知识分享网。VS2008
引用System.ServiceModel.Web.dll
引用System.Runtime.Serialization.dll
private void Form1_Load(object sender, EventArgs e)
{
string _JsonText = “Json代码”;
List<Test> _Test = new List<Test>();
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 =(List<Test>)_Json.ReadObject(_MemoryStream);
}
public class Test
{
public int cId = 0;
public string cName = “”;
public int amount = 0;
public string price = “”;
}
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/11873.html