日期:2014-05-17 浏览次数:20852 次
public MainPage()
{
InitializeComponent();
StreamResourceInfo stream = App.GetResourceStream(new Uri("Resources/heropediadata.json", UriKind.Relative));
StreamReader reader = new StreamReader(stream.Stream);
string content = Regex.Unescape(reader.ReadToEnd());
List<ItemDataModel> itemData = UtilityJsonHelper.JsonString2Obeject<List<ItemDataModel>>(content);
}
http://www.dota2.com/jsfeed/heropediadata?feeds=itemdata
[DataContract]
public class ItemDataModel
{
//物品ID
[DataMember(Name="id")]
public int ItemId { get; set; }
//物品名称
[DataMember(Name = "dname")]
public string ItemName { get; set; }
//物品图片
[DataMember(Name = "img")]
public string ItemPicName { get; set; }
//暂定??
[DataMember(Name = "qual")]
public string ItemComponent { get; set; }
//物品价格
[DataMember(Name = "cost")]
public int ItemCost { get; set; }