基本的C#MIME解码 [英] Basic C# Mime Decoding

查看:213
本文介绍了基本的C#MIME解码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有处理多部分MIME数据在C#中的清洁方式。

Is there a clean way of handling multi-part MIME data in C#.

调用一个封闭的应用程序后,(我没有获得改变它)我得到一个MIME效应初探类似下面。请问C#提供通过System.Net.Mime或System.Net.Mail来解析这个能力?

After a call to a closed application (I have no access to change it) I get a MIME reponse like the one below. Does C# provide the ability to parse this via System.Net.Mime or System.Net.Mail?

MIME-Version: 1.0
Content-Type: multipart/mixed; 
    boundary="----=_Part_42_31322961.1286389502467"

------=_Part_42_31322961.1286389502467
Content-Type: text/xml
Content-Transfer-Encoding: 7bit
Content-ID: <xmlContextInfo>
<UnneededXML> <Stuff> </Stuff> </UnneededXML>


------=_Part_42_31322961.1286389502467
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
Content-ID: <myImage>

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a

我真正需要的反应是MYIMAGE部分(这是比上面所示更长的时间)

All I really need from the response is the "myImage" portion (which is much longer than what is shown above)

推荐答案

您可以使用 OpenPOP 库其中包括MIME解析器。

You can use OpenPOP library which includes mime parser.

这篇关于基本的C#MIME解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆