• 大小: 94KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-10-09
  • 语言: 其他
  • 标签: 邮件  eml  解析  解码  

资源简介

通过base64解码和QP解码,能对绝大部分邮件的eml文件进行完整解析,提取邮件头、内容、附件、图片等数据,适合邮件协议的分析学习、进一步开发,以及相关课程作业的提交

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using MailAnylysis;
using System.Text.Regularexpressions;

namespace MailAnylysis
{
    class Anylysis
    {       
        private string mailContent = ““;
        private string subject = ““;
        private string date = ““;
        private string sender = ““;
        private string receiver = ““;
        private string carboncopy = ““;
        private string blindCarboncopy = ““;
        private string htmlCharset = ““;
        private string htmlEncoding = ““;
        private string bodyText = ““;
        private string bodyHtml = ““;
        private string boundary = ““;
        public struct Attachment{
            public string filename;
            public byte[] content;}
        public struct Picture {
            public string filename;
            public byte[] content;
        }
        public List myAttachment = new List();

        public List myPicture = new List();

        public string MailContent
        {
            get { return mailContent; }
            set { mailContent = value;
                  initializationDate();
                  GetItems();}
        }
                
        public string Subject
        {
            get { return subject; }
            set { subject = value; }
        }

        public string Date
        {
            get { return date; }
            set { date = value; }
        }

        public string Sender
        {
            get { return sender; }
            set { sender = value; }
        }

        public string Receiver
        {
            get { return receiver; }
            set { receiver = value; }
        }

        public string Carboncopy
        {
            get { return carboncopy; }
            set { carboncopy = value; }
        }

        public string BlindCarboncopy
        {
            get { return blindCarboncopy; }
            set { blindCarboncopy = value; }
        }

        public string HtmlCharset
        {
            get { return htmlCharset; }
            set { htmlCharset = value; }
        }

        public string HtmlEncoding
        {
            get { return htmlEncoding; }
            set { htmlEncoding = value; }
        }

        public string BodyText
        {
            get { return bodyText; }
            set { bodyText = value; }
        }

        public string BodyHtml
        {
            get { return bodyHtml; }
            set { bodyHtml = value; }
        }

        public string Boundary
        {
            get { return boundary; }
            set { boundary = value; }
        }


        
        /// 
        /// 初始化数据
        /// 

        private void initializationDate()
        {
            Subject = ““;
            Dat

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-11-07 20:28  MailAnylysis\
     目录           0  2015-11-07 22:03  MailAnylysis\MailAnylysis\
     文件       17422  2015-11-11 20:39  MailAnylysis\MailAnylysis\Anylysis.cs
     文件         187  2015-11-07 20:28  MailAnylysis\MailAnylysis\App.config
     文件       23115  2015-11-10 23:53  MailAnylysis\MailAnylysis\Form1.Designer.cs
     文件        5826  2015-11-10 23:53  MailAnylysis\MailAnylysis\Form1.cs
     文件        6428  2015-11-10 23:53  MailAnylysis\MailAnylysis\Form1.resx
     文件        4094  2015-11-07 23:39  MailAnylysis\MailAnylysis\MailAnylysis.csproj
     文件         531  2015-11-07 20:28  MailAnylysis\MailAnylysis\Program.cs
     目录           0  2015-11-07 20:28  MailAnylysis\MailAnylysis\Properties\
     文件        1362  2015-11-07 20:28  MailAnylysis\MailAnylysis\Properties\AssemblyInfo.cs
     文件        2876  2015-11-07 20:28  MailAnylysis\MailAnylysis\Properties\Resources.Designer.cs
     文件        5612  2015-11-07 20:28  MailAnylysis\MailAnylysis\Properties\Resources.resx
     文件        1099  2015-11-07 20:28  MailAnylysis\MailAnylysis\Properties\Settings.Designer.cs
     文件         249  2015-11-07 20:28  MailAnylysis\MailAnylysis\Properties\Settings.settings
     文件        6687  2015-11-10 23:42  MailAnylysis\MailAnylysis\Transcode.cs
     目录           0  2015-11-07 20:28  MailAnylysis\MailAnylysis\bin\
     目录           0  2015-11-07 20:49  MailAnylysis\MailAnylysis\bin\Debug\
     文件       25600  2015-11-11 20:39  MailAnylysis\MailAnylysis\bin\Debug\MailAnylysis.exe
     文件         187  2015-11-07 20:28  MailAnylysis\MailAnylysis\bin\Debug\MailAnylysis.exe.config
     文件       52736  2015-11-11 20:39  MailAnylysis\MailAnylysis\bin\Debug\MailAnylysis.pdb
     文件       22984  2015-11-19 09:03  MailAnylysis\MailAnylysis\bin\Debug\MailAnylysis.vshost.exe
     文件         187  2015-11-07 20:28  MailAnylysis\MailAnylysis\bin\Debug\MailAnylysis.vshost.exe.config
     文件         490  2012-06-06 02:06  MailAnylysis\MailAnylysis\bin\Debug\MailAnylysis.vshost.exe.manifest
     目录           0  2015-11-07 20:28  MailAnylysis\MailAnylysis\obj\
     目录           0  2015-11-11 20:39  MailAnylysis\MailAnylysis\obj\Debug\
     文件        7533  2015-11-07 23:35  MailAnylysis\MailAnylysis\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7259  2015-11-11 20:26  MailAnylysis\MailAnylysis\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         180  2015-11-11 19:34  MailAnylysis\MailAnylysis\obj\Debug\MailAnylysis.MailAnylysis.resources
     文件         180  2015-11-07 23:39  MailAnylysis\MailAnylysis\obj\Debug\MailAnylysis.Properties.Resources.resources
     文件        1208  2015-11-19 09:03  MailAnylysis\MailAnylysis\obj\Debug\MailAnylysis.csproj.FileListAbsolute.txt
............此处省略10个文件信息

评论

共有 条评论