我正在为这些Xbox 360成就爱好者构建应用程序。现在我几乎将标题,描述和指南复制到一个XML文件(我在Dropbox中)。然后我将这个信息检索到3个文本块和一个图像控件。从网站阅读信息
过程:
步骤1:
查找标题: http://www.xbox360achievements.org/game/call-of-duty-modern-warfare-3/guide/
步骤2:
复制&粘贴所有信息以XML:https://dl.dropbox.com/u/27136243/AchivementHunters/XML/Achivements%26Guides%20-%20Example.xml
步骤3:
下载XML和读取/显示数据
XDocument dataFeed = XDocument.Parse(e.Result);
try
{
if (NavigationContext.QueryString.TryGetValue("gameName", out gameName))
{
AchivementsListBox.ItemsSource = from query in dataFeed.Descendants(gameName)
select new NewGamesClass
{
TitleCode = (string)query.Element("TitleCode"),
GameTitle = (string)query.Element("Title"),
GameDescription = (string)query.Element("Description"),
GameGuide = (string)query.Element("Guide"),
GameImage = (string)query.Element("Image"),
GameVideoLink = (string)query.Element("VideoLink")
};
}
}
catch
{
MessageBox.Show("Sorry, an error has ocurr while locating the achievement list.");
}
输出:
现在,我要让我的生活由没有找到,复制容易,所有的数据手工粘贴。无论如何,我可以直接从网站访问所有这些信息,并将其显示在我的应用程序中。我仍然在学习编程的过程,所以我不知道要做什么来完成这项研究。有人能指导我走向正确的路,再加上一些例子。谢谢。
你能重新格式化代码,所以我们不必滚动到正确的阅读它?我会自己做,但我不是100%肯定我不会打破语法。 – 2012-08-02 23:04:41
使用[HtmlAgilityPack](http://htmlagilitypack.codeplex.com/)来处理页面...你不需要第2步。 – 2012-08-02 23:06:37
我用更小的版本取代了屏幕截图;他们仍然清晰,不占用太多空间。 – 2012-08-02 23:10:26