zoukankan      html  css  js  c++  java
  • lumisoft会将eml后缀格式的附件给解析成文本,这里保存成文件

    MIME_Entity[] attachments = mime.Attachments;
    foreach (MIME_Entity entity in attachments)
    {
    string fileName = entity.ContentType.Param_Name;
    string dir = Server.MapPath("~/d");
    string path = Path.Combine(dir, fileName);
    if (entity.Body is MIME_b_SinglepartBase)
    {
    MIME_b_SinglepartBase byteObj = (MIME_b_SinglepartBase)entity.Body;
    Stream decodedDataStream = byteObj.GetDataStream();
    using (FileStream fs = new FileStream(path, FileMode.Create))
    {
    LumiSoft.Net.Net_Utils.StreamCopy(decodedDataStream, fs, 4000);
    }
    }
    if (entity.Body is MIME_b_MessageRfc822)
    {
    MIME_b_MessageRfc822 byteObj = (MIME_b_MessageRfc822)entity.Body;
    Mail_Message mm = byteObj.Message;
    mm.ToFile(path, null, null);
    }
    }

  • 相关阅读:
    Windows系统的DOS常用命令
    常用pom
    ssm整合
    pom依赖集合
    json
    软件项目管理笔记-软件项目计划
    CSS
    网络配置
    用户组
    用户管理
  • 原文地址:https://www.cnblogs.com/xueyuan299/p/6405977.html
Copyright © 2011-2022 走看看