Add System.Web Reference To A Windows 10 Universal App

南楼画角 提交于 2019-12-21 21:34:06

问题


I download a project on Gitgub Basically is a Console Application. But I want to translate this C# Console Application to a Universal Windows App.

I want to use HttpUtility.UrlEncode in a windows 10 universal, but I can not find System.Web in .NET (Add Reference) How can I add this assembly to my project?

Error: The "HttpUtility" Does not existin the current context.

Im using Visual Studio 2015

I try with this question: How Add System.Web Reference To A Windows Form Application But doesnt work for the Universal 10 app.

Thanks in advance!


回答1:


The System.Web assembly is a huge monolith that Microsoft themselves seem to be moving away from.

Usually, for any functionality found within System.Web, there's a modern equivalent that can be found elsewhere.

In this case, you'd be looking for WebUtility.UrlEncode instead, which is found in the System.Net assembly and is listed as supported on the Universal Windows Platform.



来源:https://stackoverflow.com/questions/35500227/add-system-web-reference-to-a-windows-10-universal-app

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