课设留恋~

2015年3月1日开学,前一周半是web课设,做模拟邮件管理系统!


普通邮件内容:

Subject:zhongguo
Body:+OK 2139 octets
Received: from smtpbg221.qq.com (unknown [183.60.2.226])
	by mx22 (Coremail) with SMTP id SMCowECpikk2vvZUS_faAw--.35403S3;
	Wed, 04 Mar 2015 16:11:34 +0800 (CST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201307;
	t=1425456694; bh=FRiccPNDaWH1xQHe4u3igKzIHAlEmYF309ZeJ+18qKk=;
	h=X-QQ-FEAT:X-QQ-SSF:X-HAS-ATTACH:X-QQ-BUSINESS-ORIGIN:
	 X-Originating-IP:X-QQ-STYLE:X-QQ-mid:From:To:Subject:Mime-Version:Content-Type:Content-Transfer-Encoding:Date:
	 X-Priority:Message-ID:X-QQ-MIME:X-Mailer:X-QQ-Mailer:
	 X-QQ-SENDSIZE;
	b=NmzyTyQ9HoXepPRJOUmjRhYGogi5wDZq6LpYy8gkhub5c5azZbbBMiCqETCre3XNg
	 zDIj5gmxUTXuiThlGfV3SeREXPTYqeHy3Fwg5LdtIXC5g5uussEMXrNLMDcS67R2S4
	 MyQqgZtAhgYS6VBcEIt9sxTtYOsaKzMnaaw4QRuI=
X-QQ-FEAT: zaIfg0hwV2qHt+XNCmf045vllWsLqF6Zz0Xg9RAoxs4=
X-QQ-SSF: 000100000000007000000000000000Z
X-HAS-ATTACH: no
X-QQ-BUSINESS-ORIGIN: 2
X-Originating-IP: 113.57.189.215
X-QQ-STYLE: 
X-QQ-mid: webmail629t1425456694t8813204
From: "=?gb18030?B?srvP67TyyMUuLi4=?=" <[email protected]>
To: "=?gb18030?B?amVzc2ljYWZ1a2Fu?=" 
Subject: zhongguo
Mime-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_54F6BE35_094E4A90_3B7B2C7F"
Content-Transfer-Encoding: 8Bit
Date: Wed, 4 Mar 2015 16:11:33 +0800
X-Priority: 3
Message-ID: 
X-QQ-MIME: TCMime 1.0 by Tencent
X-Mailer: QQMail 2.x
X-QQ-Mailer: QQMail 2.x
X-QQ-SENDSIZE: 520
X-CM-TRANSID:SMCowECpikk2vvZUS_faAw--.35403S3
Authentication-Results: mx22; spf=pass [email protected]; dki
	m=pass [email protected]
X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73
	VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUs7PEUUUUU

This is a multi-part message in MIME format.

------=_NextPart_54F6BE35_094E4A90_3B7B2C7F
Content-Type: text/plain;
	charset="gb18030"
Content-Transfer-Encoding: base64

Y2hpbmEu

------=_NextPart_54F6BE35_094E4A90_3B7B2C7F
Content-Type: text/html;
	charset="gb18030"
Content-Transfer-Encoding: base64

PERJVj5jaGluYS48L0RJVj4=

------=_NextPart_54F6BE35_094E4A90_3B7B2C7F--


User:[email protected]


带附件的邮件

Subject:=?gb18030?B?suLK1Li9vP5+?=
Body:This is a multi-part message in MIME format.

------=_NextPart_54F93FF1_09345890_01B888C6
Content-Type: multipart/alternative;
	boundary="----=_NextPart_54F93FF1_09345890_59DAB85F";

------=_NextPart_54F93FF1_09345890_59DAB85F
Content-Type: text/plain;
	charset="gb18030"
Content-Transfer-Encoding: base64

xNyyu8TcveLO9sTYPw==

------=_NextPart_54F93FF1_09345890_59DAB85F
Content-Type: text/html;
	charset="gb18030"
Content-Transfer-Encoding: base64

PERJVj7E3LK7xNy94s72xNg/PC9ESVY+

------=_NextPart_54F93FF1_09345890_59DAB85F--

------=_NextPart_54F93FF1_09345890_01B888C6
Content-Type: application/octet-stream;
	charset="gb18030";
	name="1.txt"
Content-Disposition: attachment; filename="1.txt"
Content-Transfer-Encoding: base64

MTgzLjEzNi4xMzMuMjE4ICAgIGZvbnRzLmdvb2dsZWFwaXMuY29tDQoxODMuMTM2LjEzMy4y
MTggICAgZm9udHMuZ3N0YXRpYy5jb20NCg0KDQpodHRwOi8vYmxvZy5jc2RuLm5ldC93bXgx
NjgzNS9hcnRpY2xlL2RldGFpbHMvMzg2Mzk0NTE=

------=_NextPart_54F93FF1_09345890_01B888C6--

E
s



User:[email protected]

模块划分:

注册模块

登录模块



收件模块

文件夹模块


发件模块

群发模块

通讯录模块


解析正文时用的一个函数~

static ArrayList split(ArrayList list) {
		int n = list.Count;
		if (n == 0) {
			return new ArrayList();
		}
		ArrayList ret = new ArrayList();
		string res = "";
		for (int i = 0;i < n;i++) {
			if ((string)list[i] == "This is a multi-part message in MIME format.") {
				continue;
			}
			if (((string)list[i]).Contains("------=_NextPart")) {
				if (res.Trim() != "") {
					ret.Add(GetMailText(res));
				}
				res =  (string)list[i] + "\r\n";
			} else {
				res = res + (string)list[i] + "\r\n";
			}
		}
		if (res.Trim() != "") {
			ret.Add(GetMailText(res));
		}
		
		return ret;
	}




你可能感兴趣的:(fukan_沉淀)