资源简介
实现foxmail的邮件收取与发送,源代码。

代码片段和文件信息
// base64.cpp: implementation of the Cbase64 class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “base64.h“
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Cbase64::Cbase64() :
m_pszEncodeList( “ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=“ )
{
// 初始化解码表
unsigned int i uiIndex = 0 ;
for( i = ‘A‘ ; i <= ‘Z‘ ; ++i )
m_szDecodeList[ i ] = uiIndex++ ;
for( i = ‘a‘ ; i <= ‘z‘ ; ++i )
m_szDecodeList[ i ] = uiIndex++ ;
for( i = ‘0‘ ; i <= ‘9‘ ; ++i )
m_szDecodeList[ i ] = uiIndex++ ;
m_szDecodeList[ ‘+‘ ] = uiIndex++ ;
m_szDecodeList[ ‘/‘ ] = uiIndex++ ;
// m_szDecodeList[ ‘=‘ ] = uiIndex++ ;
}
Cbase64::~Cbase64()
{
}
/*
功能: base64编码
参数: pSource 要编码的字节
uiSize 要编码的字节大小
pDestination 编码输出
pdwWritten 编码输入的字节数,这个数一定是4的整数倍。
备注: 计算base64编码需要的字节数(不包括NULL):uiSize / 3 * 4 + uiSize % 3 ? 4 : 0 ;
*/
void Cbase64::Encode(const void *const pSource const unsigned int uiSize
void *pDestination unsigned long * const pdwWritten )
{
// 必须使用unsigned char否者位移有符号字节会得到奇怪结果。比如:213右移2位后得:245
const unsigned char *pSrc = (const unsigned char* )pSource ;
unsigned char *pDst = (unsigned char *)pDestination ;
const unsigned char * const pEnd = pSrc + uiSize - uiSize % 3 ; // 末尾
for( ; pSrc < pEnd ; pSrc += 3 pDst += 4 )
{
pDst[0] = m_pszEncodeList[ pSrc[0] >> 2 ] ;
pDst[1] = m_pszEncodeList[ ( ( pSrc[0] & 3 )<<4 ) | ( ( pSrc[1] /*& 240*/ ) >>4 ) ] ;
pDst[2] = m_pszEncodeList[ ( ( pSrc[1] & 15 ) <<2 ) | ( ( pSrc[2] /*& 192*/ ) >>6 ) ];
pDst[3] = m_pszEncodeList[ pSrc[2] & 63 ] ;
}
// 处理末尾不足3位的字节
if( uiSize % 3 == 1 ) // 如果剩余了1位,那么应该补2个=
{
pDst[0] = m_pszEncodeList[ pSrc[0] >> 2 ] ;
pDst[1] = m_pszEncodeList[ ( ( pSrc[0] & 3 )<<4 ) | ( ( pSrc[1] & 240 ) >>4 ) ] ;
pDst[2] = ‘=‘ ;
pDst[3] = ‘=‘ ;
}
else if ( uiSize % 3 == 2 )
{
pDst[0] = m_pszEncodeList[ pSrc[0] >> 2 ] ;
pDst[1] = m_pszEncodeList[ ( ( pSrc[0] & 3 )<<4 ) | ( ( pSrc[1] & 240 ) >>4 ) ] ;
pDst[2] = m_pszEncodeList[ ( ( pSrc[1] & 15 ) <<2 ) | ( ( pSrc[2] & 192 ) >>6 ) ] ;
pDst[3] = ‘=‘ ;
}
*pdwWritten = uiSize / 3 * 4 ;
if( uiSize % 3 )
*pdwWritten += 4 ;
}
/*
功能: base64解码
参数: pSource 编码后的数据buffer
uiSize 编码的大小,需要是4的整数倍
pDestination 输出buffer
pWritten 输出实际写入的字节数
返回: true 解码成功,false 失败。
备注: 输出最多需要的字节数是(不包括NULL):uiSize / 4 * 3
最多会浪费2个字节空间,当末尾有2个=号时。
并不做解码的数据合法性检查。如果做的话,需要检测每个字节高2是否是0,
这样做不太有效率。
*/
bool Cbase64::Decode(const void *const pSource const unsigned int uiSize
void *pDestination unsigned long * const pdwWritten )
{
// 如果要解码的字符数不是4的倍数,那么解码的数据肯定不合法了。
// 因为base64编码只会生成4的倍数的编码数据。
if( uiSize % 4 )
return false ;
const unsigned char *pSrc = (const unsigned char* )pSource ;
u
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5079 2010-07-26 18:11 foxmail 2010.08.10\ba
文件 867 2010-07-26 18:06 foxmail 2010.08.10\ba
文件 19340 2010-08-10 23:38 foxmail 2010.08.10\DlgFoxmail.cpp
文件 2356 2010-08-10 22:04 foxmail 2010.08.10\DlgFoxmail.h
文件 7503 2010-08-07 22:10 foxmail 2010.08.10\DlgNewMail.cpp
文件 1811 2010-08-07 03:02 foxmail 2010.08.10\DlgNewMail.h
文件 2762 2010-08-05 23:31 foxmail 2010.08.10\DlgOption.cpp
文件 1380 2010-08-04 14:37 foxmail 2010.08.10\DlgOption.h
文件 175472 2010-08-10 20:33 foxmail 2010.08.10\Foxmail.aps
文件 3207 2010-08-16 16:50 foxmail 2010.08.10\Foxmail.clw
文件 2077 2010-08-03 20:34 foxmail 2010.08.10\Foxmail.cpp
文件 5701 2010-08-11 00:42 foxmail 2010.08.10\Foxmail.dsp
文件 539 2010-08-03 20:34 foxmail 2010.08.10\Foxmail.dsw
文件 1335 2010-08-03 20:34 foxmail 2010.08.10\Foxmail.h
文件 61952 2010-08-16 17:10 foxmail 2010.08.10\Foxmail.opt
文件 2956 2010-08-16 16:50 foxmail 2010.08.10\Foxmail.plg
文件 10009 2010-08-08 00:00 foxmail 2010.08.10\Foxmail.rc
文件 4597 2010-08-10 23:16 foxmail 2010.08.10\MailIO.cpp
文件 1184 2010-08-10 23:16 foxmail 2010.08.10\MailIO.h
文件 157 2010-08-06 16:57 foxmail 2010.08.10\Options.ini
文件 4252 2010-08-10 20:50 foxmail 2010.08.10\Pop3\Pop3.cpp
文件 1289 2010-08-10 20:57 foxmail 2010.08.10\Pop3\Pop3.h
文件 3597 2010-08-03 20:34 foxmail 2010.08.10\ReadMe.txt
文件 0 2010-08-04 13:33 foxmail 2010.08.10\res\default1.bin
文件 5390 2010-08-05 16:56 foxmail 2010.08.10\res\Deleted.ico
文件 5854 2010-08-05 16:56 foxmail 2010.08.10\res\Draftbox.ico
文件 97566 2010-08-04 14:28 foxmail 2010.08.10\res\Foxmail.ico
文件 399 2010-08-03 20:34 foxmail 2010.08.10\res\Foxmail.rc2
文件 1406 2010-08-05 16:24 foxmail 2010.08.10\res\Inbox.ico
文件 1406 2010-08-04 13:54 foxmail 2010.08.10\res\New Mail 2.ico
............此处省略20个文件信息
相关资源
- 利用foxmail模板批量生成邮件
- smtp 发送邮件给多个用户带附件
- c实现pop3接收邮件
- 最新SMTP探测新版.zip
- smtp邮件服务器的编写程序
- 包含 MailServer和Foxmail的压缩包
- delphi 邮件收发系统源码(仿FOXMAIL )
- POP3协议登录邮箱查看邮件软件
- 邮件协议报文
- 最新SMTP企业邮箱探测器
- socket编程基础编写基于GUI界面的SMTP客
- QT利用SMTP发送邮件Demo
- 简单电子邮件客户端的设计与实现.
- 最新仿的Foxmail功能的源代码
- SMTP电子邮件客户端与服务器的设计与
- foxmail 7.0以上密码查看器 亲测可用
- 基于 POP3 和 SMTP 的 邮件服务端和移动
- SMTP破解器25.80.465.587端口
- Qt pop3接收邮件并附件程序
- foxmail.zip
- 邮箱服务器搭建文件,易邮服务器和
- Pop3邮件登陆(含SSL加密登陆)
- Wireshark抓包分析POP3和SMTP协议
- SMTP邮件发送客户端.rar
- 基于LabVIEW2013的远程多点温度测控系统
- 基于smtp协议的邮件发送程序
- Qt下 基于smtp协议的邮件发送客户端源
- 简易的smtp服务器与客户端的C代码
- Qt实现smtp发送邮件
- POP3邮件接收程序
评论
共有 条评论