CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 16

Threaded View

  1. #1
    Join Date
    Jun 2006
    Posts
    148

    Web Browser and Image Elements

    Hi all,

    I am trying to carry out the images from a offline webpage loaded in the webbrowser control.

    Following is the code.

    Code:
    WebBrowser wb = new WebBrowser();
    wb.Navigate("Path of the offline web page [ImageTest.htm]");
    HtmlElementCollection hec = wb.Document.Images;
    foreach (HtmlElement he in hec)
    {
          string xstr = he.GetAttribute("src");
          
          // Processing related to image
          ...............
          
          ...............
    }
    My problem is that the statement
    Code:
    HtmlElementCollection hec = wb.Document.Images
    returns zero images or no ElementCollection in the HtmlElementCollection.

    so i am not getting any image, though my offline document is having images.

    Now interesting thing is that when i simplify the webpage by editing it, i can get the image in the collection.

    Both the Normal and modified page are in the attachment.
    ImageTest.htm is the original page.
    ImageTest1.htm is the modified page.

    Thanx for any kind of help.
    Regards,
    Shail2k4
    Attached Files Attached Files

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

Featured