积极答复者
wpf string转为json

问题
答案
-
-
你好,
你的意思应该是将JSON格式的String转化成JSON的对象吧。可以使用JavaScriptSerializer 这个类来实现。
例如:
class Test { String test; String getTest() { return test; } String setTest(String test) { test = test; } }
JavaScriptSerializer jsonserializer = new JavaScriptSerializer(); Test routeslist = (Test)jsonserializer.DeserializeObject("{ \"test\":\"some data\" }");
更多信息,可以参考:http://www.codeproject.com/Tips/79435/Deserialize-JSON-with-Csharp.aspx
希望我理解对了。
谢谢!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 Leo (Apple) YangModerator 2014年4月8日 5:12
-
推荐使用Json.net扩展库,对于string to json很好用
- 已标记为答案 Leo (Apple) YangModerator 2014年4月8日 5:12
全部回复
-
-
你好,
你的意思应该是将JSON格式的String转化成JSON的对象吧。可以使用JavaScriptSerializer 这个类来实现。
例如:
class Test { String test; String getTest() { return test; } String setTest(String test) { test = test; } }
JavaScriptSerializer jsonserializer = new JavaScriptSerializer(); Test routeslist = (Test)jsonserializer.DeserializeObject("{ \"test\":\"some data\" }");
更多信息,可以参考:http://www.codeproject.com/Tips/79435/Deserialize-JSON-with-Csharp.aspx
希望我理解对了。
谢谢!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已标记为答案 Leo (Apple) YangModerator 2014年4月8日 5:12
-
推荐使用Json.net扩展库,对于string to json很好用
- 已标记为答案 Leo (Apple) YangModerator 2014年4月8日 5:12