??C#?Json????Json????????????
???????????? ???????[ 2015/7/2 14:10:08 ] ??????????????? C#
????json??????
???????.net 4.0?????????????????????json???д????????????У???????json??????????C#?????????????????????????????????????????????????????
????1????????? System.Web.Extensions
????2????????′???
1 static class Program
2 {
3 /// <summary>
4 /// ???????????
5 /// </summary>
6 static void Main()
7 {
8 string jsonStr = "{"name":"supperlitt"??"age":25??"likes":["C#"??"asp.net"]}";
9 JavaScriptSerializer js = new JavaScriptSerializer();
10 var model = js.Deserialize<TestModel>(jsonStr);
11
12 Console.WriteLine(model.name);
13 Console.WriteLine(model.age);
14 Console.WriteLine(string.Join("??"?? model.likes));
15
16 Console.ReadLine();
17 }
18
19 public class TestModel
20 {
21 public string name { get; set; }
22
23 public int age { get; set; }
24
25 public List<string> likes { get; set; }
26 }
27 }
????????????
?????????
????????????У??????????????????json???????????????????????????json??????????????????????????????????????????????C#????????????????????????????????ζ??д????????????á?????
????????LZ???????????????ù?????????????????????????Com??
??????json????????????C#??
????1????????????£??????????????????????????????
???????μ??????????????json?????????????C#?????
???????????????Microsoft.JScript.dll ???
????1 Microsoft.JScript.Vsa.VsaEngine ve = Microsoft.JScript.Vsa.VsaEngine.CreateEngine();
????2 var m = Microsoft.JScript.Eval.JScriptEvaluate("(" + jsonStr + ")"?? ve);
????2?????????m????????????JSObject?????????????????????????????????????????????????????Ч???ɡ?
?????????????web???????????json??????????д???????json???????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11