IBrowserSaveWebPage Method |
Initiates the saving process of the currently loaded web page. The web page can be saved as a
single HTML file or the file with resources. Before saving a web page make sure that it is
not being loaded. It is recommended to completely loaded the web page and only then save it.
Namespace:
DotNetBrowser.Browser
Assembly:
DotNetBrowser (in DotNetBrowser.dll) Version: 2.23.3
Syntax bool SaveWebPage(
string filePath,
string resourcesPath,
SavePageType saveType
)
Parameters
- filePath
- Type: SystemString
an absolute path to a file in which the web page will be saved. - resourcesPath
- Type: SystemString
an absolute path to a directory in which the resources (e.g. images, css)
of the web page will be saved. If the directory does not exist, it will
be created
- saveType
- Type: DotNetBrowser.BrowserSavePageType
determines how the web page will be saved: as an HTML file with all the
required resources (e.g. images, css etc.), a single HTML or MHTML file
Return Value
Type:
Booleantrue if the saving process has been initialized successfully,
false otherwise.
Exceptions Exception | Condition |
---|
ObjectDisposedException | The IBrowser has already been disposed. |
ConnectionClosedException | The connection to the Chromium engine is closed. |
ArgumentException |
The filePath is null, empty, or consists only of white-space
characters.
|
ArgumentException |
The resourcesPath is null, empty, or consists only of
white-space characters.
|
See Also