在查询字符串中使用Base64编码参数发出 [英] Issue with Base64-encoded parameter in query string

查看:300
本文介绍了在查询字符串中使用Base64编码参数发出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm sending a link in my web application to users mails (for confirming user registration) as the following :

< a target =_ blankhref =http:// localhost:2817 / ConfirmRegistration?confirm = Y0tcmGepe7wjH7A1CT1IaA ==>
http:// localhost:2817 / ConfirmRegistration?confirm = Y0tcmGepe7wjH7A1CT1IaA ==
< / a>

<a target="_blank" href="http://localhost:2817/ConfirmRegistration?confirm=Y0tcmGepe7wjH7A1CT1IaA=="> http://localhost:2817/ConfirmRegistration?confirm=Y0tcmGepe7wjH7A1CT1IaA== </a>

但Chrome会提示此消息:


But Chrome alert this message :

查询字符串是否无效?如何解决它?

Is the query string invalid ? How can I resolve it ?

BTW:

我的应用程序是C#和MVC3的

BTW:
My application is in C# and MVC3

推荐答案

您应该对确认参数进行URL编码。您收到的错误是因为最后一个 == 片段。

You should URL encode the confirm parameter. The error you get is because of the last == fragment.

对于此用途 HttpServerUtility.UrlEncode 或类似的框架方法。

For this use HttpServerUtility.UrlEncode or similar framework methods.

这篇关于在查询字符串中使用Base64编码参数发出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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