社区
C#
帖子详情
為什么Request.QueryString.Get("8×8").Trim()取出來的值是“8?8”啊?
---涛声依旧---
2007-05-09 09:31:49
我的WebConfig
<globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
若改成Big5就不會有問題了。
用utf-8的,如何取得8×8啊?
...全文
253
9
打赏
收藏
為什么Request.QueryString.Get("8×8").Trim()取出來的值是“8?8”啊?
我的WebConfig 若改成Big5就不會有問題了。 用utf-8的,如何取得8×8啊?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
namhyuk
2007-05-09
打赏
举报
回复
嗯,混点分。
hertcloud
2007-05-09
打赏
举报
回复
这个 需要 URL编码
然后 再 解码.
参考
http://blog.csdn.net/hertcloud/archive/2007/04/28/1589338.aspx
---涛声依旧---
2007-05-09
打赏
举报
回复
再30分了
---涛声依旧---
2007-05-09
打赏
举报
回复
沒有那么麻煩吧
nayc
2007-05-09
打赏
举报
回复
传过来的时候先Encode一下,然后读出来的时候在Decode一下试试
---涛声依旧---
2007-05-09
打赏
举报
回复
謝謝各位,我試試看
guyehanxinlei
2007-05-09
打赏
举报
回复
学习
kkun_3yue3
2007-05-09
打赏
举报
回复
页面处理
onsubmit="form1.Text1.value = escape(form1.Text1.value);"
.cs处理
string a = HttpUtility.UrlDecode(Text1.Value);
Response.Write(a);
//c#实现escape编码:(用在ajax中)然后在aspx用unescape解码,就不会出现乱码问题
private string escape(string s)
{
StringBuilder sb = new StringBuilder();
byte[] ba = System.Text.Encoding.Unicode.GetBytes(s);
for (int i = 0; i < ba.Length; i += 2)
{
sb.Append("%u");
sb.Append(ba[i + 1].ToString("X2"));
sb.Append(ba[i].ToString("X2"));
}
return sb.ToString();
}
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1589338
---涛声依旧---
2007-05-09
打赏
举报
回复
To:hertcloud(·£孙子兵法£·)
blog打不開啊,公司禁止上
能否把內容貼出來,謝謝!
asp页面和Asp.net页面传中文参数UrlEncode编码以及接收解码
举例:asp.net用Get方式传输的URL为:”WebPage.asp?str=”+HttpUtility.UrlEncode(str) ,解码方式为HttpUtility.UrlDecode(
Request
.
Query
String
[“str”].To
String
().
Trim
()) asp的Get方式传送为”webPage.aspx?str=”+server.urlencode(str) 两种编码不统一 解决方案:在asp使用Get方式传送”WebPage.aspx?str=”+server.urlEncode( server.URLpathencode(str)) asp.net GET
asp 获取参数
值
与sql安全过滤参数函数代码
代码如下: ‘获取参数
值
Function getForm(element,ftype) Select case ftype case “get” getForm=
trim
(
request
.
Query
String
(element)) case “post” getForm=
trim
(
request
.Form(element)) case “both” if isNul(
request
.
Query
String
(element)) then getForm=
trim
(
request
.Form(element)) else getForm=
trim
(
request
.
Query
String
(eleme
用XMLHTTP很好的一个例子
进入www.ting88.com的网站,把歌手专辑页面的URL复制到文本框中再提交就可以得到歌曲的下载路径,如:http://www.ting88.com/MusicList/4141.htm 源程序如下: <% on error resume next dim id,url,getCode,m,i,j,s,d,ns,nd,num,name id=
trim
(
request
.
query
string
(“id”)) ‘1.获取原网页所有内容 Function getHTTPPage(url) dim http set http=Server.createobject(“Micros
request
.get
Query
String
()
request
.get
Query
String
()就是获取查询字符串 比如客户端发送 http://localhost/test.do?a=b&c=d&e=f 通过
request
.get
Query
String
()得到的是 a=b&c=d&e=f 查API如下
Request
.get
Query
String
() Syntax
Request
.getQuer
request
.get
Query
String
()作用-获取URL参数
request
.get
Query
String
()是什么意思
request
.get
Query
String
()就是获取查询字符串比如客户端发送 http://localhost/test.do?a=b&c=d&e=f 通过
request
.get
Query
String
()得到的是 a=b&c=d&e=f 查API如下
Request
.get
Query
C#
110,500
社区成员
642,566
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章