How can i do the above ^^
Thanks
edit: and oh yeh not just a link of an image i mean from a tagid like :
Picture1.Image = WebBrowser1.Document.All.verificationImage
If anyone knows how to do this that would be great thanks
Printable View
How can i do the above ^^
Thanks
edit: and oh yeh not just a link of an image i mean from a tagid like :
Picture1.Image = WebBrowser1.Document.All.verificationImage
If anyone knows how to do this that would be great thanks
one way to do that is to open ur webbroswer code ("the html") like txt file. to look at the picture url in that txt then
download it to temp folder using DOWNLOADURLTOFILE. u can found it in KERNAL32.DLL. after u have the pic in the temp folder open it using pic.picture =loadpicture ("path")
The picture URL is encrypted that is why i need to open it from its html tag :)
If you know the name of the image and it's complete URL then you can do something like below. Put a Inet control on your Form.
If you only know the name of the image but you do not know it's URL then you need to do something like this:Code:Private Sub Command1_Click()
Dim s1() As Byte
s1() = Inet1.OpenURL("http://www.website.com/image.jpg", icByteArray)
Open App.Path & "\image.jpg" For Binary As #1
Put #1, 1, s3
Close #1
Picture1.Picture = LoadPicture(App.Path & "\image.jpg")
End Sub
Code:Private Sub Command2_Click()
Dim s1 As String
Dim s2 As String
Dim s3() As Byte
s1 = Inet1.OpenURL("http://www.website.com/")
q1 = InStr(1, s1, "image.jpg")
If q1 > 0 Then
For i = q1 To 1 Step -1
If Mid(s1, i, 7) = "http://" Then
q1 = q1 + Len("image.jpg")
s2 = Mid(s1, i, q1 - i)
Exit For
End If
Next i
End If
s3() = Inet1.OpenURL(s2, icByteArray)
Open App.Path & "\image.jpg" For Binary As #1
Put #1, 1, s3
Close #1
Picture1.Picture = LoadPicture(App.Path & "\image.jpg")
End Sub
Hi, thanks for your efforts :)
But no, the picture does not have a specific name like image1.jpg , ill post the complete html code that covers the image and see if anyone can come up with anything.
vb Code:
<div id="verificationImage" name="verificationImage" style="padding-right: 5px"> <a href="#" onclick="document.verificationImg.src='/cimg?c=rxgb6NDa3Tun5uTk2xhVliD0PIKT9ZYixzPpVlG5LdNwAO3W8TG5IGlvckpABlI5XRjuP9QrgN0=&'+Math.random();return false"><img name="verificationImg" src="/cimg?c=rxgb6NDa3Tun5uTk2xhVliD0PIKT9ZYixzPpVlG5LdNwAO3W8TG5IGlvckpABlI5XRjuP9QrgN0=" align="texttop" border="0"></a> </div> </td> <td style="vertical-align: bottom"> <div class="formFieldInfo"> <a href="#" onclick="document.verificationImg.src='/cimg?c=rxgb6NDa3Tun5uTk2xhVliD0PIKT9ZYixzPpVlG5LdNwAO3W8TG5IGlvckpABlI5XRjuP9QrgN0=&'+Math.random();return false">New image</a> </div> </td> </tr> </table> </td> </tr> <tr> <td class="loginFormLabel"> <div id="verificationLabel" name="verificationLabel"> <label for="verificationResponse">Word Verification:</label> </div> </td> <td> <input id="verificationResponse" size="40" name="response" maxlength="10" value="" type="text"> <div class="formFieldInfo"> Enter the text in the image </div> <input type="hidden" name="challenge" value="rxgb6NDa3Tun5uTk2xhVliD0PIKT9ZYixzPpVlG5LdNwAO3W8TG5IGlvckpABlI5XRjuP9QrgN0="/> </td> </tr> <tr>
Drop a picturebox control to your form. This code will force the webbrowser control to copy the image content to the clipboard, that you can easily paste by using the Clipboard object of vb6
vb Code:
Dim O as Object Set O = WebBrowser1.Document.body.createControlRange() Call O.Add(WebBrowser1.Document.All("verificationImg")) Call O.execCommand("Copy") Set Picture1.Picture = Clipboard.GetData
Now what do you want to do with this (verification) image?
Works like a charm :) Thank you so much.Quote:
Originally Posted by Jim Davis
And i just want to let people fill it in on my app but i have that covered :) thanks
And how to do this if verification img does not have a name:
<img src="/sw/verification/verif.php?c=login" alt="captcha" class="captcha"/>
Thanx a lot !
I get an error on this line:
Call O.Add(WebBrowser1.Document.All("verificationImg"))