(UWP) WebClient and downloading data from URL in

帅比萌擦擦* 提交于 2019-12-12 10:47:27

问题


How do you download data from an url in UWP? I'm used to using WebClient's DownloadData-method, but it can't be used anymore.


回答1:


.NET for UWP does not have the WebClient class.

But you have several alternative ways to download the data from URL in UWP.

For example:

    var request = WebRequest.CreateHttp("http://www.bing.com");

    var donnetClient = new System.Net.Http.HttpClient();

    var winrtClient = new Windows.Web.Http.HttpClient();

If you want to download the data at background, you can use the BackgroundDownloader class



来源:https://stackoverflow.com/questions/33123082/uwp-webclient-and-downloading-data-from-url-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!