QueryString malformed after URLDecode

后端 未结 11 1450
太阳男子
太阳男子 2020-12-09 11:25

I\'m trying to pass in a Base64 string into a C#.Net web application via the QueryString. When the string arrives the \"+\" (plus) sign is being replaced by a space. It appe

11条回答
  •  半阙折子戏
    2020-12-09 11:48

    If you use System.Uri.UnescapeDataString(yourString) it will ignore the +. This method should only be used in cases like yours where when the string was encoded using some sort of legacy approach either on the client or server.

    See this blog post: http://blogs.msdn.com/b/yangxind/archive/2006/11/09/don-t-use-net-system-uri-unescapedatastring-in-url-decoding.aspx

提交回复
热议问题