本文介绍了自动从网页下载验证码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我想创建一个C#应用程序,它可以自动从网站下载验证码图像。有人可以告诉我怎么可能.?

Hi!
i want to create a C# app which automatically download captcha images from a website. can somebody tells me how is it possible.?

推荐答案

<div id="recaptcha_image" style="width: 300px; height: 57px; "><img style="display:block;" alt="reCAPTCHA challenge image" height="57" width="300" src="http://www.google.com/recaptcha/api/image?c=03AHJ_Vus407GuhxqGfVSZawlQp2afR8Ov0GI0zpZolxeHbjXa5dRThbO0XWzAduWq5P7JNzA99oGPLSjuWQtnKotfv4Jy0EwkXBZv9kj9531F6YEwSop56pRTh4hOsWnO7n-CxLtH_w4pKC6OpRdw3KZZOXjgts3-Dg"></img></div>



以下是如何使用Windows窗体浏览器获取图像的示例:


Here is an example of how to get the image with a windows forms browser:

HtmlElement ele = browser.Document.GetElementById("recaptcha_image");
if (ele != null)
{
    string imageSource = ele.GetAttribute("src");
}




这篇关于自动从网页下载验证码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 18:36