(UWP) WebClient and downloading data from URL in

2019-01-28 01:17发布

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条回答
Juvenile、少年°
2楼-- · 2019-01-28 01:50

.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

查看更多
登录 后发表回答