c# - System.NotSupportedException with WebClient on Windows Phone 7 -
I have a problem using WebClient on Windows Phone 7. I am currently trying to download it in the string file so that I can parse the string using JSON.NET. Unfortunately, I can not even get the file into a string yet. Here's my code:
Private Zero GetFileAsString () {var Client = New WebClient (); Client.DownloadStringCompleted + = New DownloadStringCompletedEventHandler (sClient_DownloadStringCompleted); Client.DownloadStringAsync (new URI (searchData.searchurl, UriKind.Relative)); } Private Zero sClient_DownloadStringCompleted (Object Sender, DownloadStringCompletedEventArgs e) {if (e.Error == empty) {textBlock1.Text = e.Result; } And {textBlock1.Text = e.Error.ToString (); }} And here is a screenshot of the error I am getting:
I have seen online and I can not find the solution This problem, this The previous posts on the site are included. Any help here is greatly appreciated!
You can set your WebClient when you UriKind.Relative , Use the correct URI correctly for example - otherwise it should be the original URI ...
Comments
Post a Comment