[UWP] [C#] - HttpClient在某些W10设备上不起作用 [英] [UWP][C#] - HttpClient does not work on some W10 devices

查看:112
本文介绍了[UWP] [C#] - HttpClient在某些W10设备上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在UWP应用中使用HttpClient。但是HttpClient不会在某些设备上创建http请求。我不知道为什么。如果它是任何缺少的依赖或什么。所有设备都有操作系统Windows 10和禁用的防火墙。

I use HttpClient in my UWP app. But the HttpClient does not create http requests on some devices. I don't know why. If it is any missing dependencies or what. All devices have OS Windows 10 and disabled firewall.

当我在C#.NET控制台应用程序中使用HttpClient时,它适用于所有设备。 

It works well for all devices, when I use HttpClient in C# .NET Console Application. 

推荐答案

HttpClient有两个版本。

The HttpClient has two version.

第一个来自System.Net.Http;

The first is from System.Net.Http;

第二个是来自Windows.Web.Http;

The second is from Windows.Web.Http;

建议UWP使用Windows.Web.Http。

the UWP be suggested use Windows.Web.Http.

参考:
https://docs.microsoft.com/en-us/uwp/api/windows.web.http.httpclient


这篇关于[UWP] [C#] - HttpClient在某些W10设备上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆