解决方法
区别在于所有的空间转义 – UrlEncode将它们转义为符号,UrlPathEncode转义为。并且仅当它们是QueryString部分per W3C的一部分时才是等效的。因此,您不能使用符号,只有querystring部分来转义整个URL。 UrlPathEncode总是更好的imho
You can encode a URL using with the UrlEncode() method or the UrlPathEncode() method. However,the methods return different results. The UrlEncode() method converts each space character to a plus character (+). The UrlPathEncode() method converts each space character into the string “%20”,which represents a space in hexadecimal notation. Use the UrlPathEncode() method when you encode the path portion of a URL in order to guarantee a consistent decoded URL,regardless of which platform or browser performs the decoding.
07001
原文地址:https://www.jb51.cc/aspnet/253149.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。