Results 1 to 10 of 10

Thread: saving a webpage?

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    saving a webpage?

    I'm using webbrowser control .I want to save the current web page using (save,save as)and with multiple save file types(web archive,complete,HTML single file,text)exactly like IE.
    any help guys

  2. #2

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    SaveFileDialog can do that,if so how plz??
    Thanx in advance

  3. #3
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    You can use the System.Net namespace to get the webpage into a stream and then use a BinaryWriter with a FileStream (both from System.Io) to do this. I might have an example at work for you. Need to sleep now though....... post to tell me if you need an example and I'll try to give it in the morning (ie in 10 hours).

  4. #4
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    but if he's using webbrowser control that'd suck because he would have to download the web page all over again...

    to get the source code of the webpage open do this:

    dim mystring as string

    mystring = webbrowser1.document.body.innerhtml
    \m/\m/

  5. #5
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    Correct, I agree that the first part was something that popped out of me without thinking it all through. Doesn't leave out the use of a FileStream to write to and a StreamWriter to do the job though, does it?

  6. #6

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I couldn't reply your post athley last days .Ok , it's kind of you if you sent me that example?

  7. #7
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    darn, now I'm free for Christmas weekend. :P

    hmmm, I'll try to dig something up.

  8. #8

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I'm sorry Athley , I thought it's ready.

  9. #9
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    Yea it is, but its at work, and I'm on holiday :P

  10. #10

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    never mind

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