使用C#,无法在我正在处理的html字符串中加载.mht文档内容以下载pdf文件。下载后.MHT内容格式不正确。 bb包含该.mht文件的字节数组,该文件是附件。
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>";