Issue with Base64-encoded parameter in query string

后端 未结 5 1784
星月不相逢
星月不相逢 2021-01-18 08:56

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



        
5条回答
  •  没有蜡笔的小新
    2021-01-18 09:27

    You can send your value by replacing two char + to _ and / to -:

    string confirm=confirm.Replace('+', '_').Replace('/', '+');
    
    
    http://localhost:2817/ConfirmRegistration?confirm=@confirm
    
    

    and you can get your data in server side by using:

    if (Request.QueryString["confirm"] != null && Request.QueryString["confirm"].ToString() != "")
    {
           string confirm = HttpUtility.HtmlDecode(Request.QueryString["confirm"]).Replace('_', '+').Replace('-', '/');
    }
    

提交回复
热议问题