http://bbs.banbijiang.com/registerbbs.php
这个页面的验证码http://bbs.banbijiang.com/seccode.php?update=72425
这个链接是,生成图片的链接。不要拿网上找的资料来忽悠我,要正常测试能保存为一个Image对象的,求高手来帮忙。
这个页面的验证码http://bbs.banbijiang.com/seccode.php?update=72425
这个链接是,生成图片的链接。不要拿网上找的资料来忽悠我,要正常测试能保存为一个Image对象的,求高手来帮忙。
using (WebBrowser wb = new WebBrowser())
{
wb.ScrollBarsEnabled = false;
wb.Navigate(url);
//确保页面被解析完全
while (wb.ReadyState != WebBrowserReadyState.Complete)
{
System.Windows.Forms.Application.DoEvents();
}
int height=wb.Document.Body.ScrollRectangle.Height;
int width = wb.Document.Body.ScrollRectangle.Width; wb.Width = width;
wb.Height = height; bitmap = new System.Drawing.Bitmap(width, height);
wb.DrawToBitmap(bitmap, new System.Drawing.Rectangle(0, 0, width, height));
wb.Dispose();
}
注:我上面的代码是winform的:System.Windows.Forms.Application.DoEvents();
希望对你有点帮助