日期:2014-05-17  浏览次数:20785 次

ASP中如何把汉字和数字组合的字符串转换为16进制
各位,ASP我接触的少,现在遇到如下问题:
我在页面上点一个按钮,传递三个参数给别人的一个链接,参数全部用16进制转换
需要达到的结果
http://www.xxxx.com/aaa.jsp?username=16进制&userPass=16进制&plate=16进制

可是我ASP页面上显示的都是汉字和数字的组合。应该如何转?才能传递?

------解决方案--------------------
试试看
http://www.xxxx.com/aaa.jsp?username=<%=Server.URLEncode("xxx")%>&userPass=<%=Server.URLEncode("xxx")%>&plate=<%=Server.URLEncode("xxx")%>

------解决方案--------------------
中文的没有转换成功,你可以将其按GB2312或者UTF8的标准进行转换,可参见这里的几个函数
http://www.strongfire.cn/article/276.html