I tried to ececute the same code given by rob, i got an error message.
error message are as
-----------------------------------------
Server Error in '/NFTE' Application.
--------------------------------------------------------------------------------
Access is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access is denied.
The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.
Source Error:
Line 28: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 29: Dim htmlDOM As IHTMLDocument2
Line 30: Dim brwTest As New SHDocVw.InternetExplorer() 'WebBrowser()
-----------------------------------------------------
I have given rights access to "{machinename}\ASPNET then also it gave me the same error.............
Help please.
Mathew
Back when I was fooling around with this for the first time, I made a web app that had a textbox. Users would enter HTML in the box and submit the form to the page. I would then parse the images out of that page and save them. Here is a sample. You can start from there.
Imports MSHTML
Imports SHDocVw
Public Class TestHTMLDOM
Inherits System.Web.UI.Page
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim htmlDOM As IHTMLDocument2
Dim brwTest As New SHDocVw.InternetExplorer() 'WebBrowser()
brwTest.Navigate("about:blank")
htmlDOM = brwTest.Document
htmlDOM.body.innerHTML = Request.Form("HTMLSource")
Dim objI As IHTMLElement
For Each objI In htmlDOM.images
objI.src = "/KnowledgeBase/Support/4/test.gif"
Next
Me.TextBox1.Text = htmlDOM.body.innerHTML
htmlDOM = Nothing
brwTest.Dispose()
End Sub
End Class