错误下载页面源使用WebClient窗口电话8

时间:2014-08-08 12:46:20

标签: windows-phone-8

我正在尝试在Windows Phone 8中的youtube上下载。我已使用此代码下载页面源:

 public void DownloadWebPage(string VideoID)
        {   
string Url="http://www.youtube.com/watch?v=" + VideoID;       
            WebClient webClient = new WebClient();
            webClient.DownloadStringCompleted += new   DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted);
            webClient.DownloadStringAsync(new System.Uri(Url));
            //var html = webClient.DownloadStringAsync
        }
        public void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                MessageBox.Show(e.Error.Message);             
            }
            else
            {              
                html = e.Result;              
            }
        } 

我没有收到错误“删除服务器返回错误未找到”。我尝试使用其他页面的另一个链接,看看它是否正常工作。在Windows Phone 7.1中,它也适用于此YouTube链接。有谁能够帮我?我将非常感谢:)

0 个答案:

没有答案