0

問題は次のとおりです。リモートサーバーがエラーを返しました:NotFound

private WebClient client = new WebClient();
private string siteUrl = "http://www.google.com/";

// Constructor
public MainPage()
{
    InitializeComponent();

    client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
    client.DownloadStringAsync(new Uri(siteUrl));
}

void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) 
{
    try
    {
        if (e.Error == null)
        {
            webClientResults.Text = e.Result;
        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
} 
4

1 に答える 1

2

デバイスのネットワーク接続を確認します。このようなエラーは主に、適切なインターネット接続が利用できない場合に発生します。

コードに問題はありません。

于 2012-09-18T08:09:25.590 に答える