开发者

QueryString containing \ coming through with \\

开发者 https://www.devze.com 2023-01-29 14:45 出处:网络
I\'m have a page which I sent a parameter through the query string. I开发者_如何学JAVAf I\'m retrieving it with Request.QueryString[\"Format\"] I\'m having troubles with the type \'CD\\DVD\'. It\'s b

I'm have a page which I sent a parameter through the query string.

I开发者_如何学JAVAf I'm retrieving it with Request.QueryString["Format"] I'm having troubles with the type 'CD\DVD'. It's being returned as 'CD\\DVD'. It's important I get this as the right string.

How do I avoid the extra backslash? Or even get rid of it later?


You should try Urlencoding and decoding your querystring

http://msdn.microsoft.com/en-us/library/zttxte6w.aspx


Try doing the following:

Request.QueryString["Format"].Replace(@"\\",@"\");
0

精彩评论

暂无评论...
验证码 换一张
取 消