Want to load .mht document in html page want to make html compatible string

Using C#, Unable to load .mht document content in html string which I am processing to download a pdf file. .MHT Content is not in proper format.

byte[] bb = new byte[0];
attachmentstring = attachmentstring + "<br clear="all" style="page-break-after:always" />";
attachmentstring = attachmentstring + "<center><table border="0"><tr><td>" + attachments[a].Description.Trim() + "</td></tr></table></center><br/>";
bb = Helpers.DecryptAFile(path);
//string messageString = string.Empty;

//foreach (byte b in bb)
//{
//    messageString += (Char)b;
//}
string mht = "";
MemoryStream stream = new MemoryStream(bb);
StreamReader streader = new StreamReader(stream, System.Text.Encoding.ASCII);
mht = streader.ReadToEnd(); 
attachmentstring += "<div>" + mht + "</div>";


Source: .net

Leave a Reply