# //先在项目中添加System.Web.Extensions引用 # //using System.Web.Script.Serialization; # JavaScriptSerializer serializer = new JavaScriptSerializer(); # Dictionary<string, object> json = (Dictionary<string, object>)serializer.DeserializeObject( # "{name: 'zswang', forum: 'c#'}"); # object value; # if (json.TryGetValue("name", out value)) # Console.WriteLine(value); // 输出:zswang