91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 6.4MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-09-25
  • 語言: C/C++
  • 標簽: 郵件??MFC??C++??例子??

資源簡介

郵件收發都寫在,MyEmailClient 具體方法請看SMTP,POP3,Base64收發加密等內容, 下載即可運行

資源截圖

代碼片段和文件信息

//?AppOctetStream.cpp:?implementation?of?the?CAppOctetStream?class.
//?Author:?Wes?Clyburn?(clyburnw@enmu.edu)
//////////////////////////////////////////////////////////////////////

#include?“stdafx.h“
#include?“AppOctetStream.h“
#include?“base64.h“
#include?“MIMEMessage.h“

#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif

//?IMPORTANT:?The?number?of?bytes?we?read?must?be
//??a?multiple?of?3?because?Cbase64‘s?Encode()
//??method?will?append?padding?characters?(‘=‘)
//??to?make?the?output‘s?size?a?multiple?of?4.
//??(base64?treats?3?8-bit?bytes?as?4?6-bit?‘bytes‘).
//??MIME?decoders?are?free?to?treat?‘=‘?as?a?signal
//??that?there‘s?no?more?data?so?we?don‘t?want?to?pad
//??until?we‘re?supposed?to.
//?When?at?the?end?of?the?file?the?#?of?bytes?read
//??may?not?be?a?multiple?of?3?but?that‘s?okay
//??because?we?DO?want?the?padding?chars?then.

#define?BYTES_TO_READ?54?//?This?number?guarantess?output?won‘t
?//?won‘t?exceed?line-length?limit

//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////

CAppOctetStream::CAppOctetStream(?int?nContentType?)
:CMIMEContentAgent(?nContentType?)
{
}

CAppOctetStream::~CAppOctetStream()
{
}

BOOL?CAppOctetStream::AppendPart(LPCTSTR?szContent?
?LPCTSTR?szParameters?
?int?nEncoding?
?BOOL?bPath?
?CString?&?sDestination)
{
CStdioFile?fAttachment;

ASSERT(?szContent?!=?NULL?);
//?This?class?handles?only?file?attachments?so
//?it?ignores?the?bPath?parameter.
if(?szContent?==?NULL?)
return?FALSE;
if(?!fAttachment.Open(?szContent?(CFile::modeRead?|?CFile::shareDenyWrite?|?CFile::typeBinary)?)?)
return?FALSE;
sDestination?+=?build_sub_header(?szContent
??????szParameters
??nEncoding
??TRUE?);
attach_file(?&fAttachment?CMIMEMessage::base64?sDestination?);
fAttachment.Close();
return?TRUE;
}


CString?CAppOctetStream::build_sub_header(LPCTSTR?szContent?
??LPCTSTR?szParameters?
??int?nEncoding?
??BOOL?bPath)
{
CString?sSubHeader;
CString?sTemp;
TCHAR?szFName[?_MAX_FNAME?];
TCHAR?szExt[?_MAX_EXT?];

_tsplitpath(?szContent?NULL?NULL?szFName?szExt?);

//?This?class?ignores?szParameters?and?nEncoding.
//?It?controls?its?own?parameters?and?only?handles
//?base64?encoding.
if(?bPath?)
sTemp.Format(?“;?file=%s%s“?szFName?szExt?);
else
sTemp?=?_T(?““?);
sSubHeader.Format(?_T(?“Content-Type:?%s%s\r\n“?)
(LPCTSTR)GetContentTypeString()
(LPCTSTR)sTemp?);
sSubHeader?+=?_T(?“Content-Transfer-Encoding:?base64\r\n“?);
sTemp.Format(?_T(?“Content-Disposition:?attachment;?filename=%s%s\r\n“?)
??szFName?szExt?);
sSubHeader?+=?sTemp;
//?Signal?end?of?sub-header.
sSubHeader?+=?_T(?“\r\n“?);?//?Warning:?numerous?concatenation

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2010-07-11?12:34??完成\
?????文件????????4279??2010-07-06?15:04??完成\AppOctetStream.cpp
?????文件????????1239??1998-12-15?18:31??完成\AppOctetStream.h
?????文件????????3867??2010-07-04?23:44??完成\base64.cpp
?????文件????????1113??1998-12-15?18:31??完成\base64.h
?????文件??????296448??2000-11-06?20:03??完成\CodeExchange.exe
?????目錄???????????0??2010-07-11?12:34??完成\Debug\
?????文件???????19883??2010-07-07?10:26??完成\Debug\AppOctetStream.obj
?????文件???????????0??2010-07-07?10:26??完成\Debug\AppOctetStream.sbr
?????文件???????14854??2010-07-07?10:26??完成\Debug\base64.obj
?????文件???????????0??2010-07-07?10:26??完成\Debug\base64.sbr
?????文件???????68115??2010-07-07?10:26??完成\Debug\MailMessage.obj
?????文件???????????0??2010-07-07?10:26??完成\Debug\MailMessage.sbr
?????文件????????4530??2010-07-07?10:26??完成\Debug\MIMECode.obj
?????文件???????????0??2010-07-07?10:26??完成\Debug\MIMECode.sbr
?????文件????????5292??2010-07-07?10:26??完成\Debug\MIMEContentAgent.obj
?????文件???????????0??2010-07-07?10:26??完成\Debug\MIMEContentAgent.sbr
?????文件???????71262??2010-07-07?10:26??完成\Debug\MIMEMessage.obj
?????文件???????????0??2010-07-07?10:26??完成\Debug\MIMEMessage.sbr
?????文件?????5612544??2010-07-08?10:56??完成\Debug\MyEmailClient.bsc
?????文件?????2003064??2010-07-08?10:58??完成\Debug\MyEmailClient.exe
?????文件??????368400??2010-07-08?10:58??完成\Debug\MyEmailClient.ilk
?????文件???????17164??2010-07-07?22:47??完成\Debug\MyEmailClient.obj
?????文件?????7195324??2010-07-07?10:26??完成\Debug\MyEmailClient.pch
?????文件??????648192??2010-07-08?10:58??完成\Debug\MyEmailClient.pdb
?????文件?????1519588??2010-07-08?10:58??完成\Debug\MyEmailClient.res
?????文件???????????0??2010-07-07?22:47??完成\Debug\MyEmailClient.sbr
?????文件???????54397??2010-07-08?10:56??完成\Debug\MyEmailClientDlg.obj
?????文件???????????0??2010-07-08?10:56??完成\Debug\MyEmailClientDlg.sbr
?????文件???????33335??2010-07-07?10:26??完成\Debug\POP3.obj
?????文件???????????0??2010-07-07?10:26??完成\Debug\POP3.sbr
............此處省略45個文件信息

評論

共有 條評論