1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

decaptcher API function in .net??

Discussion in 'Visual Basic .NET' started by theviralguy, Jan 21, 2010.

  1. theviralguy

    theviralguy Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 16, 2008
    Messages:
    970
    Likes Received:
    290
    Location:
    BC
    does anyone have an example they can give me for the decaptcher api function in vb2008? thanks

    edit: i know there is one in the download page but i cant even get it to compile?
     
    Last edited: Jan 21, 2010
  2. Rein1418

    Rein1418 BANNED BANNED

    Joined:
    Apr 11, 2008
    Messages:
    312
    Likes Received:
    52
    I just copied the whole class to the vb project, and then just slightly modified the example code that they have. You also need to have the dll on the bin project folder.
     
  3. smack

    smack Junior Member

    Joined:
    Feb 1, 2010
    Messages:
    182
    Likes Received:
    78
    Occupation:
    Software Engineer/Evil Genius
    Location:
    inside .NET
    did you get this resolved?

    i have a class that does the decap interaction, but it relies on a proprietary http class.

    my suggestion is to form your requests as strings and send them as a POST using HTTPWebRequest.

    the POST data string for your captcha image submit will look something like this:

    Code:
    
    Dim postData as string = ""
    dim bound as string = ""
    
    bound = "-----------------------------fdgehg43yh43hge"
          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 & _
          "0" & vbNewLine & bound & vbNewLine & _
          "Content-Disposition: form-data; name=""pict_type""" & vbNewLine & vbNewLine & _
          "0" & vbNewLine & bound & vbNewLine & _
          "Content-Disposition: form-data; name=""print_format""" & vbNewLine & vbNewLine & _
          "table" & vbNewLine & bound & "--"
    
    
    then you would post that to hxxp://decaptcher.com/poster/

    since your username and password are included in that multipart boundary form you don't need to worry about your authentication step.

    the response from that POST will come back as an HTML table that you will need to parse for the word text.

    as an aside i recommend a connection timeout of about 10 - 12 seconds and a transfer timeout of around 90 seconds for that request.

    hope this helps. :)