Results 1 to 3 of 3

Thread: [Resolved]code for vb6 from vb.net

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    126

    Resolved [Resolved]code for vb6 from vb.net

    ive searching for an hour but i can find it.or maybe i found it but i didnt know..

    this code is from vb.net

    on webbrowser document complete.

    Dim sImage As String
    sImage = WebBrowser1.Document.All("avatar").GetAttribute("src")
    PictureBox1.ImageLocation = sImage


    "avatar" this is the name tag of html (name="avatar")

    "scr" this is the link of the image ex: scr="imagelink.jpg"

    i just want to know,what is the code for vb6?

    how to get attribute?


    thanks...
    Last edited by Joke Sparrow; Oct 7th, 2009 at 01:20 AM.

  2. #2
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: code for vb6 from vb.net

    This should work.
    Code:
    Private Sub Command1_Click()
    Dim ie
    Dim strSrc As String
    Dim srtURL As String
    Dim strAttribValue As String
    
        'Add correct values
        strURL = "www.google.com"
        strAttribValue = "logo"
    
        Set ie = CreateObject("internetexplorer.application")
        ie.navigate strURL
        
        Do While ie.ReadyState < 4 'READYSTATE_COMPLETE
            DoEvents
        Loop
    
        strSrc = ie.Document.getElementById(strAttribValue).getAttribute("src")
        Debug.Print strSrc
        
        Set ie = Nothing
    End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    126

    Re: code for vb6 from vb.net

    works like a charm..hehehe...

    thanks Markt..

    thread resolved...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width