电子邮件收发系统毕业论文 第11页
int toend = parts[i].IndexOf(">");
To = parts[i].Substring(tobegin + 1, toend - tobegin - 1);
}
catch
{
int tobegin = parts[i].IndexOf(":");
To = parts[i].Substring(tobegin + 1);
}
}
else if (parts[i].IndexOf("Cc:") == 0)
{
try
{
int ccbegin = parts[i].IndexOf("<");
int ccend = parts[i].IndexOf(">");
Cc = parts[i].Substring(ccbegin + 1, ccend - ccbegin - 1);
}
catch
{
int ccbegin = parts[i].IndexOf(":");
Cc = parts[i].Substring(ccbegin + 1);
}
}
else if (parts[i].IndexOf("Subject:") == 0)
{
int Subjectbegin = parts[i].IndexOf(":");
if (parts[i].Substring(Subjectbegin + 1).Trim("\r\n".ToCharArray()).Trim() != "")
{
if (parts[i].Substring(Subjectbegin + 1).IndexOf("?=") > 0)
{
string ZWFormat = parts[i].Substring(Subjectbegin + 1).Remove(parts[i].Substring(Subjectbegin + 1).Length - 3, 2).Remove(1, 2);
string[] Subjects = ZWFormat.Split('?');
byte[] buff = Convert.FromBase64String(Subjects[2]);
Subject = System.Text.Encoding.Default.GetString(buff);
}
else
Subject = parts[i].Substring(Subjectbegin + 1);
}
else
Subject = "[无主题]";
}
else if (parts[i].IndexOf("Content-Transfer-Encoding: base64") == 0)
{
i++;
while (i < parts.Length && parts[i].IndexOf("----=") < 0)
{
if (parts[i].IndexOf("X-Priority:") < 0 && parts[i].IndexOf("X-MSMail-Priority:") < 0 && parts[i].IndexOf("X-Mailer:") < 0 && parts[i].IndexOf("X-MimeOLE:") < 0)
MailContent += parts[i];
i++;
}
break;
}
}
byte[] MailcontentB = Convert.FromBase64String(MailContent);
MailContent = System.Text.Encoding.Default.GetString(MailcontentB);
}
catch { }
}
private void ParserTextMail(string content)
{www.wlfree.com
try
{
string[] parts;
parts = content.Split("\r\n".ToCharArray());
int i = 0;
for (i = 0; i < parts.Length; i++)
{
if (parts[i].IndexOf("for <") > 0 && parts[i].IndexOf(">;") > 0 && parts[i].IndexOf("+") > 0)
{
string[] Dates = parts[i].Trim().Split(';');
Date = Dates[1].Trim();
}
else if (parts[i].IndexOf("From:") == 0)
{
int frombegin = parts[i].IndexOf(":");
From = parts[i].Substring(frombegin + 1).Trim();
}
else if (parts[i].IndexOf("To:") == 0)
{
int tobegin = parts[i].IndexOf(":");
To = parts[i].Substring(tobegin + 1).Trim();
}
else if (parts[i].IndexOf("Cc:") == 0
<< 上一页 [11]
电子邮件收发系统毕业论文 第11页下载如图片无法显示或论文不完整,请联系qq752018766