开发者

C# WatiN cannot capture webpage to file

i'm getting error message when trying to capture web page. On my computer it works well but at my work it doesn't. Here is error http://imageshack.us/photo/my-images/717/asdasfrfdf.jpg/ I'm using common code browser.CaptureWebPageToFile(address). C开发者_如何转开发an anybody give me some suggestions? Thanks


I had a similar issue a while back. Give this a go: -

using WatiN.Core.UtilityClasses;
...
string fName = @"C:\test.jpg";
using (FileStream fStr = new FileStream(fName, FileMode.Create, FileAccess.Write, FileShare.None))
{
    CaptureWebPage cwp = new CaptureWebPage(browser.DomContainer);
    cwp.CaptureWebPageToFile(fStr, CaptureWebPage.ImageCodecs.Jpeg, true, false, 100, 100);
    fStr.Close();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜