UWP 中有 HttpListener 吗?

Is there a HttpListener in UWP?

我在 UWP 中工作,我无法使用系统 API 中的 HttpListener class。 Windows API 中有新功能吗?

is there a new feauture in the Windows API?

UWP 应用程序不支持所有 .NET API。您可以检查 .NET for UWP apps 以查看 UWP 中所有受支持的 .NET API。

对于您的情况,您应该查看:StreamSocketListener in Windows.Networking.Sockets Namespace。你可以自己用StreamSocketListener做一个类似的httplistener

.Net Standard 2.0 支持它。

https://blogs.msdn.microsoft.com/dotnet/2017/10/10/announcing-uwp-support-for-net-standard-2-0/

它包含在 .NET Standard 2.0 中。滚动到 HttpListener 的文档页面底部,查看包含它的 .NET 版本:https://docs.microsoft.com/en-us/dotnet/api/system.net.httplistener?view=netstandard-2.1#applies-to

.NET 标准 2.0 包含在 Windows 版本 10.0.16299 中。什么版本的 .NET Standard 包含在什么版本的 Windows 可以在这里看到:https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support