0

I am trying to load an embedded mht resource. The file displays OK in IE and Chrome, so the externally referenced jpgs are packaged into the file OK, it seems:

    appBrowser.DocumentStream = getHelpHtml();

    private System.IO.Stream getHelpHtml()
    {
        var assembly = Assembly.GetExecutingAssembly();

        var resourceName = "MyApp.Resources.Help.mht";
        return assembly.GetManifestResourceStream(resourceName);
    }

Problem is, when I click on the browser (it's on a tab), the file is there but the image files are not. The web page is blue and the web page starts like this:

From: "Saved by Internet Explorer 11" Subject: Help: Getting Started Date: Mon, 10 Feb 2014 14:46:03 -0500 MIME-Version: 1.0 Content-Type: multipart/related; type="text/html"; boundary="----=_NextPart_000_0029_01CF266E.D2507520" X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7601.17609 This is a multi-part message in MIME format. ------=_NextPart_000_0029_01CF266E.D2507520 Content-Type: text/html; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable Content-Location: file://Z:\programming\C =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20

What is happening? When I save the file in IE it saves OK but then says it cannot save it. But it has.

Ron
  • 2,435
  • 3
  • 25
  • 34
  • Possible duplicate: http://stackoverflow.com/questions/4705139/how-to-load-mht-from-stream-string-into-a-webbrowser-control – Anton Tykhyy Feb 10 '14 at 20:33
  • The browser needs to know where to look for the image files. It cannot know when you use the DocumentStream property. There's is no URL for that. – Hans Passant Feb 10 '14 at 21:45
  • But isn't the purpose of the MHT format to eliminate that? Aren't all the jpgs included physically in that file? – Ron Feb 10 '14 at 21:56

0 Answers0