Dim http As New HTTPsession(SessionType.Standard)
Dim resp As HttpResponse
Dim bound As String = rndNum(15, False)
Dim postData As String = ""
Dim sreq As New SearchRequisites
Dim dRet As New DecaptcherReturn
With http
.ConnectionTimeout = 15
.TransferTimeout = 90
.ContentType = "multipart/form-data; boundary=---------------------------" & bound
End With
With sreq
.AddAND("<table><tr>")
.AddAND("</tr></table>")
End With
bound = "-----------------------------" & bound
postData = bound & vbNewLine & _
"Content-Disposition: form-data; name=""function""" & vbNewLine & vbNewLine & _
"picture2" & vbNewLine & bound & vbNewLine & _
"Content-Disposition: form-data; name=""username""" & vbNewLine & vbNewLine & _
name & vbNewLine & bound & vbNewLine & _
"Content-Disposition: form-data; name=""password""" & vbNewLine & vbNewLine & _
pw & vbNewLine & bound & vbNewLine & _
"Content-Disposition: form-data; name=""pict""; filename=""" & rndStr(10, True) & "." & fileExt & """" & vbNewLine & _
"Content-Type: " & fileType & vbNewLine & vbNewLine & _
img & vbNewLine & bound & vbNewLine & _
"Content-Disposition: form-data; name=""pict_to""" & vbNewLine & vbNewLine & _
"2" & vbNewLine & bound & vbNewLine & _
"Content-Disposition: form-data; name=""pict_type""" & vbNewLine & vbNewLine & _
PictType & vbNewLine & bound & "--"
Try
resp = http.Request("http://poster.decaptcher.com", sreq, "", postData)
If resp.GetSearchRequisiteStatus = ReqResult.andPositive Then
dRet = New DecaptcherReturn(resp.GetResponseString)
End If
resp.Dispose()
Catch ex As Exception
Debug.WriteLine(ex.ToString)
End Try