不错呦!smile@林凯西,确保“准备文件”中的几个文件都有安装,S...您好,看了您这篇帖子觉得很有帮助。但是有个问题想请...我的修改过了怎么还被恶意注册呢 @jjjjiiii 用PJ快9年了,主要是A...PJ3啊,貌似很少有人用PJ了,现在不是WP就是z...@332347365,我当时接入时错误码没有-10...楼主,ChkValue值应为-103是什么意思呢?...大哥 你最近能看到我发的信息,请跟我联系,我有个制...
慎用Request.Params获取参数值
编辑:dnawo 日期:2009-04-25
今天一通道技术反映我们提交过去的url太长了,形如:
在日志中找了相应的记录,日志如下:
并没有多提交内容,最后发现原因是对方使用HttpContext.Current.Request.Params获取参数值。我们先来看一个例子:
1).http://localhost:1043/net/Send.aspx不带参数时结果:
/net/Send.aspx //说明:Request.ServerVariables["url"]
/net/Send.aspx //说明:Request.ServerVariables["url"]
2).http://localhost:1043/net/Send.aspx?url=http://www.mzwu.com/带参数时结果:
http://www.mzwu.com/,/net/Send.aspx //说明:Request.QueryString["url"],Request.ServerVariables["url"]
http://www.mzwu.com/ //说明:Request.QueryString["url"]
现在非常清楚了,我们来查看下官方两个方法的说明吧:
HttpContext.Current.Request.Params是获取 System.Web.HttpRequest.QueryString、System.Web.HttpRequest.Form、System.Web.HttpRequest.ServerVariables 和 System.Web.HttpRequest.Cookies 项的组合集合;
HttpContext.Current.Request是从System.Web.HttpRequest.Cookies、System.Web.HttpRequest.QueryString、System.Web.HttpRequest.Form 和 System.Web.HttpRequest.ServerVariables 集合中获取指定的对象。
所以上边的问题只需将HttpContext.Current.Request.Params改为HttpContext.Current.Request即可。
引用内容
http://service.5k3g.com/r.aspx?i=8986272,/ay/bajie10669611.ashx
在日志中找了相应的记录,日志如下:
引用内容
http://219.140.177.243/ay/bajie10669611.ashx?pid=5&phone=13182000000&name=%e5%a8%83%e5%a8%83&url=http%3a%2f%2fservice.5k3g.com%2fr.aspx%3fi%3d8986272
并没有多提交内容,最后发现原因是对方使用HttpContext.Current.Request.Params获取参数值。我们先来看一个例子:
复制内容到剪贴板 程序代码
Response.Write(HttpContext.Current.Request.Params["url"]);
Response.Write(HttpContext.Current.Request["url"]);
Response.Write(HttpContext.Current.Request["url"]);
1).http://localhost:1043/net/Send.aspx不带参数时结果:
/net/Send.aspx //说明:Request.ServerVariables["url"]
/net/Send.aspx //说明:Request.ServerVariables["url"]
2).http://localhost:1043/net/Send.aspx?url=http://www.mzwu.com/带参数时结果:
http://www.mzwu.com/,/net/Send.aspx //说明:Request.QueryString["url"],Request.ServerVariables["url"]
http://www.mzwu.com/ //说明:Request.QueryString["url"]
现在非常清楚了,我们来查看下官方两个方法的说明吧:
HttpContext.Current.Request.Params是获取 System.Web.HttpRequest.QueryString、System.Web.HttpRequest.Form、System.Web.HttpRequest.ServerVariables 和 System.Web.HttpRequest.Cookies 项的组合集合;
HttpContext.Current.Request是从System.Web.HttpRequest.Cookies、System.Web.HttpRequest.QueryString、System.Web.HttpRequest.Form 和 System.Web.HttpRequest.ServerVariables 集合中获取指定的对象。
所以上边的问题只需将HttpContext.Current.Request.Params改为HttpContext.Current.Request即可。
评论: 0 | 引用: 0 | 查看次数: 13058
发表评论
请登录后再发表评论!