[英]Get and display json data in windows phone
我已经为iOS开发了很多应用程序,现在我想学习Windows手机开发。
在Windows Phone中我想在listView中显示数据
I want to display this json data in my ListView,
{
"Event_Id":2673,
"Event_Name":"Bruno Mars",
"Event_Navigateurl":"bruno-mars",
"IphoneImage":"http://mywebsite/images/6349764112819brunomars_34628_1_1_20130227170016.jpg",
"Price":38.5,
"SubCategory":"Rock and Pop",
"SubCategoryURL":"rock-and-pop",
},
{
"Event_Id":752,
"Event_Name":"One Direction",
"Event_Navigateurl":"one-direction",
"IphoneImage":"http://mywebsite/images/634848503231825onedirection_34537_1_1_20110926162229.jpg",
"Price":10,
"SubCategory":"Rock and Pop",
"SubCategoryURL":"rock-and-pop",
},
{
. . .
}
可以任何人建议,如何从URL显示此json数据。
请帮助我是Windows手机的新手。
提前致谢。
请参考我的问题。 我有相同的查询来绑定列表框中的json数据。 所以,请参考此链接。
我希望你得到你的查询的解决方案。
并从url获取json数据。 为此请参考此代码。
Public MyJson()
{
String myUrl = "Your WebService URL";
WebClient wc = new WebClient();
wc.DownloadStringAsync(new Uri(myUrl), UriKind.Relative);
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
}
private void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
var myData = e.Result;
// You will get you Json Data here..
}
最后,您将轻松获得您的Json数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.