向高手请教邮件接收编程问题。 我想编一个电子邮件接收软件,我用POP3从邮件取回来了邮件的内容,但只能显示文本,请问如何把图片,附件等从中分离出来。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个问题我问过无数次了,可得到的都是base64解码如何解码!(愤怒) #define DBASE64(a) (a>='A' && a<='Z')?a-'A': \ (a>='a'&&a<='z')?(a-'a')+26: \ (a>='0'&&a<='9')?(a-'0')+52: \ (a=='+')?(62):(a=='/')?(63): -1int CBase64Code::DecodeBase64(char * chInBuf, char *chOutBuf){ try { int nInLen = strlen(chInBuf); if(nInLen < 1) { chOutBuf = '\0'; return 0; } else { int nValue = 0; int nFree = 0; int nInPos = 0 , nOutPos = 0; do { if(nFree >= 8) { chOutBuf[nOutPos ++] = nValue >> (nFree - 8); nFree -= 8; } else { if(nInPos < nInLen) { nValue <<= 6; int nTempValue = DBASE64((unsigned int)chInBuf[nInPos]); if(nTempValue < 0) return ERROR_WRONGCHARCODE; else { nValue |= nTempValue & 0x3f; nFree += 6; nInPos ++; } } else break; } }while(true); chOutBuf[nOutPos] = '\0'; return nOutPos; } } catch(...) { return ERROR_EXCEPTION; }} 这个问题可以用继承解决吗? MFC的TRACE,不输出是怎么回事。 求一本游戏编程的电子书要附带源码的 ACE编译设置 在Unicode中使用ACE vc连接sql,和以前的那些人有些不同的 如何在文档中加入滚动条 单选按钮的问题,帮忙解决一下 谁能帮我看一下这段代码问题出在哪? 获取焦点 关于数据库ODBC的编程问中一个基本问题 about 代理服務器,來者有分 原来不支持Socket的mfc程序加什么可以使它支持#include""??
如何解码!(愤怒)
(a>='a'&&a<='z')?(a-'a')+26: \
(a>='0'&&a<='9')?(a-'0')+52: \
(a=='+')?(62):(a=='/')?(63): -1int CBase64Code::DecodeBase64(char * chInBuf, char *chOutBuf)
{
try
{
int nInLen = strlen(chInBuf);
if(nInLen < 1)
{
chOutBuf = '\0';
return 0;
}
else
{
int nValue = 0;
int nFree = 0;
int nInPos = 0 , nOutPos = 0;
do
{
if(nFree >= 8)
{
chOutBuf[nOutPos ++] = nValue >> (nFree - 8);
nFree -= 8;
}
else
{
if(nInPos < nInLen)
{
nValue <<= 6;
int nTempValue = DBASE64((unsigned int)chInBuf[nInPos]);
if(nTempValue < 0)
return ERROR_WRONGCHARCODE;
else
{
nValue |= nTempValue & 0x3f;
nFree += 6;
nInPos ++;
}
}
else
break;
}
}while(true);
chOutBuf[nOutPos] = '\0';
return nOutPos;
}
}
catch(...)
{
return ERROR_EXCEPTION;
}
}