Form1.winsockaddphoto.Connect "208.100.34.90", 80 Case 1 Debug.Print "连接成功,发送数据包" Dim x As String Debug.Print Now() & " 正在添加好友,等待回应..." & vbCrLf x = "POST /ajax/hit_photo.php?what=up&ID=" & addphotoname & " HTTP/1.1" & vbCrLf x = x & "Accept: text/javascript, text/html, application/xml, text/xml, */*" & vbCrLf x = x & "Accept-Language: zh-cn" & vbCrLf x = x & "x-prototype-version: 1.6.0.2" & vbCrLf x = x & "Referer: http://www.flixya.com/photo/" & addphotonameb & " " & vbCrLf x = x & "x-requested-with: XMLHttpRequest" & vbCrLf x = x & "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" & vbCrLf x = x & "Accept-Encoding: gzip, deflate" & vbCrLf x = x & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" & vbCrLf x = x & "Host: www.flixya.com" & vbCrLf x = x & "Content-Length: 0" & vbCrLf x = x & "Connection: Keep-Alive" & vbCrLf x = x & "Cache-Control: no-cache" & vbCrLf x = x & Form1.Text2.Text & vbCrLf & vbCrLf Form1.winsockaddphoto.SendData x State3 = 2 End Select End Sub
Sub addphoto() '好友添加过程
Select Case State3
Case 0
Form1.winsockaddphoto.Connect "208.100.34.90", 80
Case 1
Debug.Print "连接成功,发送数据包"
Dim x As String
Debug.Print Now() & " 正在添加好友,等待回应..." & vbCrLf
x = "POST /ajax/hit_photo.php?what=up&ID=" & addphotoname & " HTTP/1.1" & vbCrLf
x = x & "Accept: text/javascript, text/html, application/xml, text/xml, */*" & vbCrLf
x = x & "Accept-Language: zh-cn" & vbCrLf
x = x & "x-prototype-version: 1.6.0.2" & vbCrLf
x = x & "Referer: http://www.flixya.com/photo/" & addphotonameb & " " & vbCrLf
x = x & "x-requested-with: XMLHttpRequest" & vbCrLf
x = x & "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" & vbCrLf
x = x & "Accept-Encoding: gzip, deflate" & vbCrLf
x = x & "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" & vbCrLf
x = x & "Host: www.flixya.com" & vbCrLf
x = x & "Content-Length: 0" & vbCrLf
x = x & "Connection: Keep-Alive" & vbCrLf
x = x & "Cache-Control: no-cache" & vbCrLf
x = x & Form1.Text2.Text & vbCrLf & vbCrLf
Form1.winsockaddphoto.SendData x
State3 = 2
End Select
End Sub