欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp頁面和Asp.net頁面?zhèn)髦形膮?shù)UrlEncode編碼以及接收解碼

 更新時(shí)間:2010年04月14日 13:59:55   作者:  
在asp中加一個(gè)鏈接,指向asp.net網(wǎng)頁,但asp.net的網(wǎng)址是經(jīng)過HttpUtility.UrlEncode轉(zhuǎn)換和HttpUtility.UrlDecode解碼的,而asp的server.urlencode卻和HttpUtility.UrlEncode的編碼方式不一樣.
舉例:asp.net用Get方式傳輸?shù)腢RL為:"WebPage.asp?str="+HttpUtility.UrlEncode(str)
,解碼方式為HttpUtility.UrlDecode(Request.QueryString["str"].ToString().Trim())
asp的Get方式傳送為"webPage.aspx?str="+server.urlencode(str) 兩種編碼不統(tǒng)一

解決方案:在asp使用Get方式傳送"WebPage.aspx?str="+server.urlEncode( server.URLpathencode(str))
asp.net GET方式傳送參數(shù):"WebPage.aspx?str="+ HttpUtility.UrlEncode( str,System.Text.Encoding.GetEncoding("gb2312"))
asp.net GET方式接收參數(shù):str= HttpUtility.UrlDecode(Request.QueryString["str"].ToString().Trim(),System.Text.Encoding.GetEncoding("gb2312"))

相關(guān)文章

最新評(píng)論