【发布时间】:2011-11-14 11:32:33
【问题描述】:
我尝试使用在线 base 64 解码器并成功解码文本和图片附件。
但是,当涉及到 MS word 和 Excel 附件时,我无法对其进行解码 您能否建议我正确的解码方法。
任何帮助表示赞赏!
【问题讨论】:
-
发布您正在尝试处理的邮件的 MIME 标头,以便我们查看它们。
-
样本编码字符串在此处page-monitor.com/Downloads/test.txt。我想解码上述内容并将其写入 docx 文件
-
它似乎是有效的 base64 数据。你用什么来解码它?
-
System.Text.UTF8Encoding 编码器 = new System.Text.UTF8Encoding(); System.Text.Decoder utf8Decode = encoder.GetDecoder(); byte[] todecode_byte = Convert.FromBase64String(data); int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); char[] decoded_char = new char[charCount]; utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);结果 = 新字符串(decoded_char);
-
如果 word 和 excel 文件是二进制文件,那么我想你可能不想经历 utf8Decode 步骤。
标签: lotus-notes