System.Windows.Forms.WebBrowser.DocumentStream Property

Gets or sets a stream containing the contents of the Web page displayed in the System.Windows.Forms.WebBrowser control.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public System.IO.Stream DocumentStream { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use this property to load a Web page into the System.Windows.Forms.WebBrowser control from a System.IO.Stream object. You can use this property, for example, to load Web pages from a database or resource file. When you set this property, the System.Windows.Forms.WebBrowser control automatically navigates to the about:blank URL before loading the specified text. This means that the WebBrowser.Navigating, WebBrowser.Navigated, and WebBrowser.DocumentCompleted events occur when you set this property, and the value of the WebBrowser.Url property is no longer meaningful.

Note:

This property contains the contents of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the System.Windows.Forms.WebBrowser control has not had time to load the new content. You can retrieve the new value in a WebBrowser.DocumentCompleted event handler.

To access the contents of a Web page as a string, use the WebBrowser.DocumentText property. You can also access the page contents using the HTML document object model (DOM) through the WebBrowser.Document property.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0