德code转义网址,而无需使用HttpUtility.UrlDe code [英] Decode escaped Url without using HttpUtility.UrlDecode
问题描述
是否有一个转义的URL字符串转换为它的转义形式的任何功能? System.Web.HttpUtility.UrlDe code()
能做到这一点的工作,但我不希望添加的引用的System.Web .DLL
。由于我的应用程序不是一个Web应用程序,我不希望添加一个依赖关系,只能用一个功能在装配。
Is there any function that converts an escaped Url string to its unescaped form? System.Web.HttpUtility.UrlDecode()
can do that job but I don't want to add a reference to System.Web.dll
. Since my app is not a web application, I don't want to add a dependency for only using a function in an assembly.
更新:查看里克施特拉尔的博客文章差不多问题。
推荐答案
编辑::使用静态方法 Uri.UnescapeDataString()
脱code你的网址:
Use the static method Uri.UnescapeDataString()
to decode your URLs:
恩codeD:的<$c$c>http%3a%2f%2fwww.google.com%2fsearch%3fhl%3den%26q%3dsomething%20%2323%26btnG%3dGoogle%2bSearch%26aq%3df%26oq%3d$c$c>
德codeD:的 http://www.google.com/search?hl=en&q=something#23安培; btnG =谷歌+搜索和; AQ = F&放大器; OQ =
这篇关于德code转义网址,而无需使用HttpUtility.UrlDe code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!