Private Sub Command1_Click()
Dim http As Object, q_post As String, User As String, Pass As String
Set http = CreateObject("Microsoft.XMLHTTP")
http.open "POST", "http://www.01xs.com/", Falsehttp.setRequestHeader "Accept", "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, */*" '表示我们所用的浏览器能接受的Content-typehttp.setRequestHeader "Referer", "http://www.01xs.com" '当前页面是从那个页面链接来的http.setRequestHeader "Accept-Language", "zh-cn" '语言http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" '表示客户端提交给服务器文本内容的编码方式是URL编码,即除了标准字符外,每字节以双字节16进制前加个“%”表示http.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQPinyin 689; TencentTraveler 4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)" '显示出本机的相关系信息,呵呵,这是我的信息大家可以去掉不用发这条http.setRequestHeader "Host", "www.01xs.com" '所请求的主机http.setRequestHeader "Content-Length", "90" '表示提交的数据字节大小http.setRequestHeader "Cache-Control", "no-cache" '返回消息中的Cache用于指定网页缓存http.setRequestHeader "Connection", "Keep-Alive" '数据传递完并不立即关闭连接User = "ceshi"
Pass = "111aaa"q_post = "username=" & User & "&password=" & Pass
http.send (q_post)WebBrowser1.Navigate "http://www.01xs.com"Set http = Nothing
End Sub
这样也不行.....
Dim info1 As StringPrivate Sub Command1_Click()
info1 = ""
Winsock1.Close
Winsock1.RemoteHost = "http://www.01xs.com/"
Winsock1.RemotePort = 80
Winsock1.Connect
End SubPrivate Sub Winsock1_Connect()
info1 = info1 + "POST /User/LoginCheck.aspx HTTP/1.1" + vbCrLf
info1 = info1 + "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-silverlight, */*" + vbCrLf
info1 = info1 + "Accept-Encoding: gzip, deflate" + vbCrLf
info1 = info1 + "Accept-Language: zh-cn" + vbCrLf
info1 = info1 + "Cache-Control: no-cache" + vbCrLf
info1 = info1 + "Connection: Keep-Alive" + vbCrLf
info1 = info1 + "Content-Length: 85" + vbCrLf
info1 = info1 + "Content-Type: application/x-www-form-urlencoded" + vbCrLf
info1 = info1 + "Cookie: ASP.NET_SessionId=m0o0nmn2eh5e0f450mbb5o45; WanerSoftLanguage=0; AJSTAT_ok_pages=20; AJSTAT_ok_times=2; WsChapterRead=0,408128,408150" + vbCrLf
info1 = info1 + "Host: www.01xs.com" + vbCrLf
info1 = info1 + "Referer: http://www.01xs.com/" + vbCrLf
info1 = info1 + "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQPinyin 689; TencentTraveler 4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)" + vbCrLf
info1 = info1 + "username=" & "ceshi" + vbCrLf
info1 = info1 + "&password=111aaa" + vbCrLf
Winsock1.SendData info1
WebBrowser1.Navigate "http://www.01xs.com"
End Sub