Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Webbrowser control

Webbrowser control

Scheduled Pinned Locked Moved C#
csharpquestion
4 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hung_ngole
    wrote on last edited by
    #1

    Hi, I'm using Webbrowser control with .NET 2.0, Can you tell me how I can autosave the web page after navigation successful? Hung.

    Hung

    S 1 Reply Last reply
    0
    • H hung_ngole

      Hi, I'm using Webbrowser control with .NET 2.0, Can you tell me how I can autosave the web page after navigation successful? Hung.

      Hung

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      Write an event handler for the WebBrowser.DocumentCompleted event that accesses the document content via the WebBrowser.Document, WebBrowser.DocumentText or WebBrowser.DocumentStream property and uses one of the return values to save the document.


      "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

      www.troschuetz.de

      H 1 Reply Last reply
      0
      • S Stefan Troschuetz

        Write an event handler for the WebBrowser.DocumentCompleted event that accesses the document content via the WebBrowser.Document, WebBrowser.DocumentText or WebBrowser.DocumentStream property and uses one of the return values to save the document.


        "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

        www.troschuetz.de

        H Offline
        H Offline
        hung_ngole
        wrote on last edited by
        #3

        I have saved DocumentText into a file, but when loading this file using web browser, the webpages' images disappear. How can I auto_save the web page as the SaveAs function of WebBrowser? Thanks, Hung.

        Hung

        S 1 Reply Last reply
        0
        • H hung_ngole

          I have saved DocumentText into a file, but when loading this file using web browser, the webpages' images disappear. How can I auto_save the web page as the SaveAs function of WebBrowser? Thanks, Hung.

          Hung

          S Offline
          S Offline
          Stefan Troschuetz
          wrote on last edited by
          #4

          I'm afraid there is no build-in support for this (at least not without user interaction). The HtmlDocument instance returned by the WebBrowser.Document property exposes an Images property that returns a collcetion of all image tags of the document. Retrieve the image URLs (shown in the documentation of the HtmlDocument.Images property), download them by using a child of the WebRequest class and then finally save them.


          "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

          www.troschuetz.de

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups