WebBrowser Control - Saving Source

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

WebBrowser Control - Saving Source

 
0
  #1
Feb 5th, 2009
Hey, im just wondering how to say the source of a webpage that is in your WebBrowser Control.

I've tried loads of methods but i am failing horribly (google isnt my friend today). Just wondering if someone could share some insight .
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 104
Reputation: Aneesh_Argent is an unknown quantity at this point 
Solved Threads: 18
Aneesh_Argent Aneesh_Argent is offline Offline
Junior Poster

Re: WebBrowser Control - Saving Source

 
0
  #2
Feb 6th, 2009
Hope this will be helpful

http://support.microsoft.com/kb/329014
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

Re: WebBrowser Control - Saving Source

 
0
  #3
Feb 6th, 2009
Originally Posted by Aneesh_Argent View Post
Hope this will be helpful

http://support.microsoft.com/kb/329014
i already read through all that lol and i didn't understand
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 104
Reputation: Aneesh_Argent is an unknown quantity at this point 
Solved Threads: 18
Aneesh_Argent Aneesh_Argent is offline Offline
Junior Poster

Re: WebBrowser Control - Saving Source

 
0
  #4
Feb 6th, 2009
Originally Posted by FTProtocol View Post
i already read through all that lol and i didn't understand
Even I dont understand the whole article
But U just need to do this:

Include references to the Mshtml.dll file . To do this in your Visual C# .NET project, follow these steps:

1. Click Add Reference on the Project menu.
2. Click the COM tab.
3. Double-click Microsoft HTML Object Library.

On your View Source button or menu Click do this:

  1.  
  2. mshtml.HTMLDocument objHtmlDoc = (mshtml.HTMLDocument) webBrowser1.Document.DomDocument;
  3. /*webBrowser1 is the WebBrowser Control showing your page*/
  4. string pageSource = objHtmlDoc.documentElement.innerHTML;
  5.  
  6. /* pageSource string variable will contain the source of the page displayed in your browser control. You can dispaly it in whatever way u wish to */
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



Tag cloud for C#
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC