首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

.关于数据提交的有关问题.算是送分的吧.100分.

2012-02-25 
在线等..关于数据提交的问题.算是送分的吧.100分....我要向一网页提交数据.问题都不大.就是网页的服务端对

在线等..关于数据提交的问题.算是送分的吧.100分....
我要向一网页提交数据.问题都不大.就是网页的服务端对提交进行的保护,禁止从外部提交数据.请问如何突破这个限制?有相关代码或者解决文章吗?我在网上找了很久也没找到..

[解决办法]
不知道你所说的限制是什么意思.我觉得一般网站限制从外部提交数据都是通过判断数据包的Referer:项来达到的.你可以通过提交这个项来达到欺骗服务器的目的.
比如 Referer: http://www.sina.com/long.asp这个只是举个例子,其意思就是你通过http://www.sina.com/long.asp这个连接访问的你提交数据的页面.
[解决办法]
GET方法
Winsock1.SendData "GET /left.asp HTTP/1.1 " & vbCrLf & _
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */* " & vbCrLf & _
"Referer: http://www.xxxxxxxxxxxxxx.com/onlin_game.htm " & vbCrLf & _
"Accept-Language: zh-cn " & vbCrLf & _
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) " & vbCrLf & _
"Host: www.xxxxxx.com " & vbCrLf & _
"Connection: Keep-Alive " & vbCrLf & vbCrLf
[解决办法]
POST方法
info = "username=**********&password=***********&x=26&y=12 "
x = Len(info)

Winsock1.SendData "POST /left.asp?action=login HTTP/1.1 " & vbCrLf & _
"Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */* " & vbCrLf & _
"Referer: http://www.xxxxxxxxxxxxxxxx.com/left.asp " & vbCrLf & _
"Accept-Language: zh-cn " & vbCrLf & _
"Content-Type: application/x-www-form-urlencoded " & vbCrLf & _
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) " & vbCrLf & _
"Host: www.xxxxxxxxxxxxxx.com " & vbCrLf & _
"Content-Length: " & CStr(x) & vbCrLf & _
"Connection: Keep-Alive " & vbCrLf & _
"Cache-Control: no-cache " & vbCrLf & vbCrLf & _
info

热点排行