asp.net C# Request.QueryString[“sms”] +符号

发布于 2024-11-15 19:28:50 字数 449 浏览 6 评论 0原文

我的客户端有 2 个服务器,然后从第一个服务器想要发送带有一些参数的请求,第二个服务器使用 get 方法获取这些参数,问题是当请求到来时,其中有一个 + 符号,例如在血型中为 A+ ,B+,O+

数据正常,但是当我插入记录时,它会从中删除 + 符号。

我怎样才能完成它,因为它们之间有一些空间。

获取方法

http://domain.com/join.aspx?msid=238487987328&短信=彼得 D 23 O+ 印第安纳

当我使用 Request.QueryString["sms"] 获取它时,它删除了 + 符号

谢谢 问候

my client have 2 server and from first server then want to send a request with some parameters and the second server take those parameters with get method, the problem is when the request come there is a + sign in it for e.g in blood group its A+, B+, O+

The data is coming fine but when I am inserting the record its removing + sign from it.

how can I get it done, as there is some space between them.

get method

http://domain.com/join.aspx?msid=238487987328&sms=Peter
D 23 O+ Indiana

when I am getting it with Request.QueryString["sms"] its removing + sign

Thanks
Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

榕城若虚 2024-11-22 19:28:50

您需要对参数进行 URL 编码(或相反,整个 URL)。

You need to URL encode the parameters (or rather, the whole URL).

小草泠泠 2024-11-22 19:28:50

+ 符号是空格的编码版本,因此需要 URL 编码 来保留它。

事实上,您需要对任何 URL 传递的参数进行 URL Encode,记下以备将来!

The + sign is the encoded version of a space, and therefore need URL Encoding to preserve it.

In fact, you need to URL Encode any URL passed parameters, make a note for the future!

横笛休吹塞上声 2024-11-22 19:28:50

+ 符号进行编码,然后将其添加到您的查询字符串中

Encode + sign then add it to your query string

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文