日期:2014-05-17 浏览次数:20491 次
protected void Page_Load(object sender, EventArgs e)
{
CDO.Message oMsg = new CDO.Message();
string emlFilePath = @"c:\test.eml";
ADODB.Stream stm = new ADODB.Stream();
stm.Open(System.Reflection.Missing.Value,
ADODB.ConnectModeEnum.adModeUnknown,
ADODB.StreamOpenOptionsEnum.adOpenStreamUnspecified,
"", "");
stm.Type = ADODB.StreamTypeEnum.adTypeBinary;
stm.LoadFromFile(emlFilePath);
oMsg.DataSource.OpenObject(stm, "_stream");
stm.Close();
CDO.IBodyPart iPrt;
int attachemtnCount = oMsg.Attachments.Count;
for (int i = 1; i <= attachemtnCount; i++) {
byte[] info_AttachmentBody;
ADODB.Stream stm1;
iPrt = oMsg.Attachments[i] ;
string attachmentFileName = iPrt.FileName;