信息发布→ 登录 注册 退出

asp页面和Asp.net页面传中文参数UrlEncode编码以及接收解码

发布时间:2026-01-11

点击量:
举例:asp.net用Get方式传输的URL为:"WebPage.asp?str="+HttpUtility.UrlEncode(str)
,解码方式为HttpUtility.UrlDecode(Request.QueryString["str"].ToString().Trim())
asp的Get方式传送为"webPage.aspx?str="+server.urlencode(str) 两种编码不统一

解决方案:在asp使用Get方式传送"WebPage.aspx?str="+server.urlEncode( server.URLpathencode(str))
asp.net GET方式传送参数:"WebPage.aspx?str="+ HttpUtility.UrlEncode( str,System.Text.Encoding.GetEncoding("gb2312"))
asp.net GET方式接收参数:str= HttpUtility.UrlDecode(Request.QueryString["str"].ToString().Trim(),System.Text.Encoding.GetEncoding("gb2312"))
在线客服
服务热线

服务热线

4008888355

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

打开微信

微信号已复制,请打开微信添加咨询详情!