QueryString中特殊字符(&)的问题 [英] Problem with Special character (&) in QueryString

查看:302
本文介绍了QueryString中特殊字符(&)的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在从Querystring中读取值,如下所示:

I am reading value from Querystring as below

string check = Request.QueryString ["Check"];

string check=Request.QueryString["Check"];

支票的值为Nidhi,查询字符串中的实际值为Nidhi& Nitin.

Value of check coming as Nidhi and actual value in querystring is Nidhi&Nitin.

但它一直读到Nidhi并无视Nitin.我想获得全部价值.

But it is reading till Nidhi and ignoring the Nitin. I want to get whole value.

我该怎么办...?

请帮助

 

 

推荐答案

这可能有很多原因,其中之一是字符串中某种程度上存在零字节(它将停止读取.Net中的字符串)

This can have many reasons, one of those is that there is somehow a zero byte in the character string (which stops reading a string in .Net)

可能是HTTPutility htmlEncode将解决此问题.

Probably the HTTPutility htmlEncode will solve this.

http://msdn.microsoft.com/en-us/library /system.web.httputility.htmlencode.aspx


这篇关于QueryString中特殊字符(&)的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆