**:
#include <
string>
using
namespace std;
class zbase64 ;
#include
"stdafx.h
"#include
"zbase64.h
"string zbase64::encode(
const unsigned
char* data,
int databyte) ;
int linelength=
0; for(
int i=
0;iint)(databyte /
3);i++)
} //對剩餘資料進行編碼
int mod=databyte %
3; if(mod==
1) else
if(mod==
2) return strencode; }
string zbase64::decode(
const
char* data,
int databyte,
int& outbyte) ;
//返回值string strdecode;
int nvalue;
int i=
0; while (i
} i +=
4; }
else
//回車換行,跳過
}return strdecode; }
使用示例(結合cximage庫):
cstring cscandlg::encodeimage()
void cscandlg::decodeimagedata(cstring strdata)
Base64編譯碼 C 版
include string using namespace std class zbase64 include stdafx.h include zbase64.h string zbase64 encode const unsigned char data,intdatabyte int lin...
Base64編譯碼 C 版
include string using namespace std class zbase64 include stdafx.h include zbase64.h string zbase64 encode const unsigned char data,int databyte int li...
Base64編譯碼 C 版
include string using namespace std class zbase64 include stdafx.h include zbase64.h string zbase64 encode const unsigned char data,int databyte int li...