c# - How to get image from WebBrowser control -
i have webbrowser control, after navigating page need download image. used following code:
htmlelementcollection tagscoll = webbrowser1.document.getelementsbytagname("img"); foreach (htmlelement currenttag in tagscoll) { ... using (var client = new webclient()) { ... client.downloadfile(currenttag.getattribute("src"), path); ... } }
but, in case webclient starts new session, , link in new session not correct. need in same session webbrowser, in case correct link image.
how can this?
try downloading image using urldownloadtofile, should give same session , cache used webbrowser
.
Comments
Post a Comment