using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.IO;
namespace MailResolve
{
public partial class FormSesolve : Form
{
StreamReader sr;
string MailFlag;
public FormSesolve()
{
InitializeComponent();
}
private void buttonResolve_Click(object sender, EventArgs e)
{
textBoxSubject.Text = "";
textBoxTo.Text = "";
textBoxFrom.Text = "";
textBoxCc.Text = "";
richTextBoxContent.Text = "";
richTextBoxAtt.Text = "";
//创建字符串输入流
sr = new StreamReader(GenerateStreamFromString(richTextBoxMail.Text));
string str;
int i;
while (sr.EndOfStream == false)
{
str = sr.ReadLine();
if ((i = str.IndexOf("Subject:")) == 0)
{
//修改标题
textBoxSubject.Text = Conv(str.Substring(8));
continue;
}
if ((i = str.IndexOf("From:")) == 0)
{
//修改发件人,存在一个如果发件人为多行会导致显示不全,没有进行相应的处理
textBoxFrom.Text = Conv(str.Substring(5));
continue;
}
if ((i = str.IndexOf("To:")) == 0)
{
//此处收件人地址和发件人存在相同问题
textBoxTo.Text = Conv(str.Substring(3));
continue;
}
if ((i = str.IndexOf("Cc:")) == 0)
{