Copy the image Captcha to a picturebox C #

0

I am doing a small program that only serves to open a session on a page, but I would like to see the captcha code that shows the same in a PictureBox of my program. Is this possible? : huh:

I already know how to make what I enter in a Textbox of my application load in the login form of the page directly using GetElementById and InvokeMember to click on the buttons (clarify if necessary): P

I'm not saying try to interpret what the captcha says (as to do robot and that) just show it in a PictureBox

I hope you give me some guidance on this and that it has been clear.

Greetings.

    
asked by Rodriguez Martinez Alfredo 15.05.2017 в 20:19
source

1 answer

0

depends a lot on the system that uses the page to generate the captcha, but broadly you can do the following.

If your captcha is an image, the code marks something like that

 <img src="../jcaptcha.jpg" />

just download it

using (WebClient client = new WebClient()) 
  {
    client.DownloadFile(new Uri('https://dominio/jcaptcha.jpg'), @"c:\temp\captcha.jpg");

   }

probably when you download it will not be the same as you saw, since they are generated dynamically, now the important thing is that if you are sending a request with the answer is that you must include in it the same cookies session when you downloaded it, otherwise it will always mark you incorrect

    
answered by 15.05.2017 / 20:39
source