Hi,
I need help and understanding when Writing html file to HTMLDocument instance. Html file contains <script type="text/javascript">.... </script>. It seems stops when it reaches to '<script type="text/javascript">' and won't return to calling function.
I think it is permission issue since I can run it successfully from my development box, or run it as a console test app in web server but when I deploy actual code to web server, it won't work. I am using Windows server 2012 and Asp.Net 4
This is a snap code that I have problem with.
Dim NewDocument As New mshtml.HTMLDocument
Dim SrcStream As New IO.FileStream(HtmlFilename, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)
Dim NewDocument2 As mshtml.IHTMLDocument2 = DirectCast(NewDocument, mshtml.IHTMLDocument2)
Do
Dim b(1023) As Byte
Dim cnt As Integer = SrcStream.Read(b, 0, b.Length)
If (cnt > 0) Then
NewDocument2.write(System.Text.UTF8Encoding.UTF8.GetString(b, 0, cnt)) <----- issue
Else
Exit Do
End If
Loop
SrcStream.Close()
SrcStream.Dispose()
NewDocument2.close()
Please help me to resolve this issue.
Thanks
I need help and understanding when Writing html file to HTMLDocument instance. Html file contains <script type="text/javascript">.... </script>. It seems stops when it reaches to '<script type="text/javascript">' and won't return to calling function.
I think it is permission issue since I can run it successfully from my development box, or run it as a console test app in web server but when I deploy actual code to web server, it won't work. I am using Windows server 2012 and Asp.Net 4
This is a snap code that I have problem with.
Dim NewDocument As New mshtml.HTMLDocument
Dim SrcStream As New IO.FileStream(HtmlFilename, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.Read)
Dim NewDocument2 As mshtml.IHTMLDocument2 = DirectCast(NewDocument, mshtml.IHTMLDocument2)
Do
Dim b(1023) As Byte
Dim cnt As Integer = SrcStream.Read(b, 0, b.Length)
If (cnt > 0) Then
NewDocument2.write(System.Text.UTF8Encoding.UTF8.GetString(b, 0, cnt)) <----- issue
Else
Exit Do
End If
Loop
SrcStream.Close()
SrcStream.Dispose()
NewDocument2.close()
Please help me to resolve this issue.
Thanks