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

VB.NET ~ Captcha - I can reload captcha but picture box doesn't reload. Please help

Discussion in 'Visual Basic .NET' started by simpleonline1234, Sep 22, 2011.

  1. simpleonline1234

    simpleonline1234 Junior Member

    Joined:
    Jan 26, 2010
    Messages:
    169
    Likes Received:
    13
    I have a pretty easy bot setup that enters username/passwords, etc.

    There is an recaptcha involved. I can send text to the textbox on the screenvia clicking a button and submit the form.

    My issue is when I need to get a new captcha I'm having issues.

    I am able to code the button to refresh the captcha on the screen. My issue is that I can't figure out how to refresh the picture box to grab the new image.

    How is it possible to refresh a captcha image and not the entire web page?

    Thanks
     
  2. scriptomania

    scriptomania Junior Member

    Joined:
    Dec 28, 2010
    Messages:
    127
    Likes Received:
    249
    Occupation:
    A full time pirate at sea
    Location:
    The European capital of politics
    Try making a sample HTTP request to the server, capture the packets, see what the request string looks like then replicate it with your bot. I'm guessing some javascript is involved here and would be fairly easy to replicate. Only one way to find out 100% though...

    Hope this helps.
     
  3. captchaman

    captchaman Junior Member

    Joined:
    Sep 16, 2010
    Messages:
    190
    Likes Received:
    842
    Occupation:
    Software Programmer
    Location:
    USA
    Simpleonline1234, you should really consider checking the MSDN Library before posting here. And, you'd better give BHW credit on your bot or we will come after you with pitchforks.

    http://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox.aspx

    Code:
     Private MyImage As Bitmap
    
     Public Sub ShowMyImage(fileToDisplay As String, xSize As Integer, _
                            ySize As Integer)
         ' Sets up an image object to be displayed.
         If (MyImage IsNot Nothing) Then
             MyImage.Dispose()
         End If
    
         ' Stretches the image to fit the pictureBox. 
         pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
         MyImage = New Bitmap(fileToDisplay)
         pictureBox1.ClientSize = New Size(xSize, ySize)
         pictureBox1.Image = CType(MyImage, Image)
     End Sub
    
     
  4. simpleonline1234

    simpleonline1234 Junior Member

    Joined:
    Jan 26, 2010
    Messages:
    169
    Likes Received:
    13
    Awesome...thanks captchaman.....yeah I know I've been leaning on the BHW forum for a lot of my coding. I am going to do more than just give the BHW props.

    When I get done with my bot I am going to give it away for free on here.

    A little bit of everything all rolled into one app. It will be open source as well.

    It's the least I could do after all the help I was given. :cool: