的Request.QueryString - 空间取代+(加号) [英] Request.QueryString - replacing + (plus) sign with space
问题描述
abcd.aspx?ST=f7aABcBdHIm7E8/0SAWKGtz8qKkhwNpJuZ+Jh+Jg+jg=&ET=d0698IjyKXsfkDDAmgy79kOd8+ONzX6IlgSrDME0QHw=
abcd.aspx?ST=f7aABcBdHIm7E8/0SAWKGtz8qKkhwNpJuZ+Jh+Jg+jg=&ET=d0698IjyKXsfkDDAmgy79kOd8+ONzX6IlgSrDME0QHw=
当我用下面的code在我的.cs页:
when I use the below code in my .cs page:
Request.QueryString["ST"]
它返回值:
"f7aABcBdHIm7E8/0SAWKGtz8qKkhwNpJuZ Jh Jg jg="
它取代的+号用空格字符()。
It replaced the + sign with a space character (" ").
不知道如何解决这个问题?
Any idea how to solve this?
推荐答案
+
标志具有查询字符串中的语义。它是用来重新present的空间。
+
sign has a semantic meaning in the query string. It is used to represent a space.
Server.UrlEncode(Request.QueryString["ST"])
您可以使用 Server.UrlEn code
。空格()转换为加号(+)。
You can use Server.UrlEncode
. Spaces ( ) are converted to plus signs (+).
参考:的http:// MSDN。 microsoft.com/en-us/library/ms525738%28v=vs.90%29.aspx
这篇关于的Request.QueryString - 空间取代+(加号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!