I'm trying to do this : http://www.vbforums.com/showthread.php?p=3754316
But using VB.Net instead of VB6.
I run into a problem with WebBrowser1.Document.Body.createcontrolrange()
Thanks for the help.
Printable View
I'm trying to do this : http://www.vbforums.com/showthread.php?p=3754316
But using VB.Net instead of VB6.
I run into a problem with WebBrowser1.Document.Body.createcontrolrange()
Thanks for the help.
bump
bump
what code have you currently got?
hint:
you need to obtain the image path and use a Stream to read it and then read from stream using the Image class, finally setting the Picturebox Image property to that image object.
Be sure to import the System.IO namespace and System.Net namespace
C#:
VB.NET:Code:WebRequest r = WebRequest.Create("http://websitehere.com/picture.jpg");
HttpWebResponse response = (HttpWebResponse)r.GetResponse();
Stream st = response.GetResponseStream();
this.pictureBox1.Image = Image.FromStream(st);
Code:Dim request As WebRequest = WebRequest.Create("http://websitehere.com/myimage.jpg")
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
Dim st As Stream = response.GetResponseStream()
Me.PictureBox1.Image = Image.FromStream(st)
I have already tried using WebRequest but I can't use that method because the image expires after it is already viewed once(On WebBrowser) so I need to extract it directly from whats already loaded. Thanks.
i dont understand what you mean by the image expires already? Care to elaborate?
Basically the image is a Captcha, after it loads the first time anytime you try to load it again, it displays Captcha Expired.
well of course it will with such things. i dont think its possible to do what you are trying to do. is there a reason you are doing what you are doing?
Well it's possible here : http://www.vbforums.com/showthread.php?p=3754316 but it's for VB6, I'm wondering how to use that method in .NET
but not for the captcha :) be it if you use VB6 or not.
in the link, all they are doing is getting hold of the image, doing a clipboard copy, and pasting it into the picturebox.
Sounds to me that he/she is trying to create some kind of spam-tool... Am I correct?
who knows but captcha was developed specifically for a purpose :)
;) hehehe.