带有“+”符号的查询字符串在传递到另一个页面时包含 space

Query string with "+" symbol contains space when passed to another page

在将查询传递到另一个页面之前,它包含参数

UwHe6N8aN0ZAHhestx+adQ==

但是通过的时候,接收页面得到了

UwHe6N8aN0ZAHhestx adQ==

改为值。

“+”自动转换为 space。

如何停止查询参数的自动转换?

因为你应该正确地UrlEncode那个字符串:

var str = "UwHe6N8aN0ZAHhestx+adQ==";
Console.WriteLine(Uri.EscapeDataString(str));

或者,考虑到好像是ASP.NET申请,可以用HttpContext.Current.Server.UrlEncode instead.