Issue with mshtml.HTMLDocument Write method ..

Discussion in '.NET' started by M-SH, May 10, 2016.

  1. M-SH

    M-SH

    Joined:
    May 10, 2016
    Messages:
    3
    Likes Received:
    1
    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
     
    M-SH, May 10, 2016
    #1
    1. Advertisements

  2. M-SH

    M-SH

    Joined:
    May 10, 2016
    Messages:
    3
    Likes Received:
    1
    Hi,

    Just to inform all, I think, found the solution to my problem. Set property designMode to "on".
     
    M-SH, May 11, 2016
    #2
    Ian likes this.
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Ike

    String into HTMLDocument

    Ike, Apr 5, 2004, in forum: Java
    Replies:
    1
    Views:
    9,770
    Rhino
    Apr 5, 2004
  2. T. Sander
    Replies:
    0
    Views:
    4,461
    T. Sander
    Jul 12, 2004
  3. El Zorro

    HTMLDocument getElement fails

    El Zorro, Aug 5, 2005, in forum: Java
    Replies:
    0
    Views:
    759
    El Zorro
    Aug 5, 2005
  4. swilson@acs.on.ca

    HTMLDocument and Xpath

    swilson@acs.on.ca, Feb 3, 2006, in forum: Python
    Replies:
    3
    Views:
    959
    swilson@acs.on.ca
    Feb 7, 2006
  5. Jay Kappel
    Replies:
    21
    Views:
    2,933
    Yan-Hong Huang[MSFT]
    May 7, 2004
  6. Steve
    Replies:
    0
    Views:
    1,006
    Steve
    Oct 27, 2006
  7. James Marshall
    Replies:
    8
    Views:
    411
    Richard Cornford
    Oct 21, 2003
  8. M-SH

    mshtml.HTMLDocument Write issue

    M-SH, May 10, 2016, in forum: ASP .Net
    Replies:
    0
    Views:
    585
Loading...