473,469 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Web Browser control getting the document downloaded

Hi,

Is there a way to get the current content of the web browser control? As in
the browser is the "View Source" functionality?

thanks.

/m
Nov 15 '05 #1
2 1905
Yeah, this is a pretty simple process.

You use the WebBrowser's document property to get the actual the HTML
document into an IHTMLDocument2 interface.

So it'll be something like this:
IHTMLDocument2 idoc = wb.document;

Then with the interface, you can get access to the body HTML using

string source = idoc.body.innerHTML;

But as i re-read your post, I notice the above solution only gives the
<body> HTML as opposed to the entire source. I've never really had to
do that before, but the above will give a start on what you'll need to
do. I imagine it's not much more difficult.
On Thu, 4 Dec 2003 23:05:13 +1100, "Muscha" <mu****@no.spam.net>
wrote:
Hi,

Is there a way to get the current content of the web browser control? As in
the browser is the "View Source" functionality?

thanks.

/m


Nov 15 '05 #2
If all you want is to get a string that contains the entire HTML
document, you can do:

string html = ((IHTMLDocument3)webBrowser.Document).documentElem ent.outerHTML;
"Muscha" <mu****@no.spam.net> wrote in message news:<OU**************@tk2msftngp13.phx.gbl>...
Hi,

Is there a way to get the current content of the web browser control? As in
the browser is the "View Source" functionality?

thanks.

/m

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" ...
0
by: amita | last post by:
hi, 1.I want to show a image file of type '.tif' in the browser window; for that I'm writting as ASP code page. 2.This '.tif' type image can be shown better with 'Kodak Image Control'. 3.To...
0
by: Hadi | last post by:
Hello, I'm using webbrowser control in my application and I am trying to get the source of the document. I have tried using: ((IHTMLDocument3)axWebBrowser.Document).documentElement.outerHTML;...
9
by: hzgt9b | last post by:
I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the...
0
by: AlanF | last post by:
Here is my perplexing issue and I've looked EVERYWHERE for help (well almost everywhere.... probably should have started here :)) I am using a Webclient to successfully retrieve a "downloadata"...
0
by: Muscha | last post by:
Hi, Is there a way to get the current content of the web browser control? As in the browser is the "View Source" functionality? thanks. /m
0
by: John Mac | last post by:
I have a program that encapsulates the IE browser via the AxSHDocVw.AxWebBrowser technique. All works fine. It seems to me there should be a way to locate and wire up to an ActiveX/COM...
5
by: Mark Rae | last post by:
Hi, I'm writing a web app in VS.NET 2003, part of which allows users to download reports in the form of XML documents to their local machine for further processing. I'm using a 3rd-party Java...
10
by: Viken Karaguesian | last post by:
Hello everyone, Me again. Trying to learn some more :>) I hope I got the terminology right. How does a browser parse (correct term?) an HTML document. I'm sure that every browser does it a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.