System.Net.WebException:远程服务器返回错误:NotFound

时间:2014-09-09 13:35:56

标签: c# xml compiler-errors windows-phone-8-emulator

当我编译到Windows 8手机时,我不断收到此错误。

我想从API网址输出一些XML。

当我在浏览器中使用我的URL时,我得到了正确的XML格式,但是当我在Visual Studio 2013 Premium中编译时,我仍然遇到此错误。

private void WebQuestion()
{
    System.Net.WebClient wc = new WebClient();

    // Add event handlers when webbclienten received answers
    wc.OpenReadCompleted += wc_OpenReadCompleted;

    // Invoking web service asynchronously and let the answer be handled 
    string URL = "https://api.steampowered.com/IDOTA2Match_570/GetMatchDetails/V001/?match_id=885221892&key=D38259AC7F57D17B10F73A76C1873DD2&format=XML";

    wc.OpenReadAsync(new Uri(URL));  
}

void wc_OpenReadCompleted(object sender, System.Net.OpenReadCompletedEventArgs e)
{
    if (e.Error != null)
    {
        return;
    }
    try
    {
        something
    }
}

0 个答案:

没有答案