有什么方法可以将加载的图片从网页浏览器捕获或复制到图片框?如何将网页浏览器中加载的图像复制到图片框
我想要复制的图像是“验证码”图像,并且每个请求都会发生变化。我需要在浏览器中加载的图像与图片框相同。
我试图拆分img
标记并再次请求图像。它工作,但图片框图像是不一样的网络浏览器显示。
这是我迄今为止所做的。它包含一个网页浏览器,一个图片框,一个文本框和一个按钮
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.IO;
using System.Net;
namespace arman_dobare_kir_mishavad
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string str2 = webBrowser1.DocumentText;
string[] strArray2;
strArray2 = Regex.Split(Regex.Split(str2, "<img id=\"content1_imgCaptcha\" src=\"")[1], "\"");
textBox1.Text = strArray2[0];
this.pictureBox1.ImageLocation = "http://www.hashkiller.co.uk" + strArray2[0];
return;
}
public void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
}
}
}
告诉我们你做了什么 – Shaharyar 2014-09-25 17:31:49
好的我编辑了我的文章... – sci3nt15t 2014-09-25 17:37:00
什么是调试时的'strArray2 [0]'? – 2014-09-25 17:47:38