base64code 的一个例子代码
来源:互联网 发布:nodejs oracle linux 编辑:程序博客网 时间:2024/05/16 12:47
#include "stdafx.h"#include <string>#include <iostream>#include <vector>#include <atlenc.h>struct CartoonInfo{std::wstring strInfo;};typedef std::vector<CartoonInfo> VEC_CI;VEC_CI g_vci;void AddInfo(LPCWSTR info){CartoonInfo ci;ci.strInfo = info;g_vci.push_back(ci);}int _tmain(int argc, _TCHAR* argv[]){LPCWSTR srcInfo = L"123";std::string strSrc = (LPCSTR)CW2A(srcInfo);int nSrcLen = strSrc.length()*2;char *pDstInfo = new char[nSrcLen*2];memset(pDstInfo, 0, nSrcLen*2);int nDstLen = nSrcLen*2;ATL::Base64Encode((BYTE*)strSrc.c_str(), nSrcLen, pDstInfo, &nDstLen);AddInfo(CA2W(pDstInfo));delete[] pDstInfo;pDstInfo = NULL;VEC_CI::iterator iter = g_vci.begin();for(;iter!=g_vci.end(); ++iter){long nSrcSize = (*iter).strInfo.size();BYTE *pDecodeStr = new BYTE[nSrcSize];memset(pDecodeStr, 0, nSrcSize);int nLen = 100;ATL::Base64Decode(CW2A((*iter).strInfo.c_str()), nSrcSize, pDecodeStr, &nLen);std::wcout<<(char*)pDecodeStr<<std::endl;delete[] pDecodeStr;pDecodeStr = NULL;}return 0;}
- base64code 的一个例子代码
- Base64Code
- 一个代码滥用的例子
- 一个listView的例子代码
- 一个不错的加解密代码例子
- 一个提升代码执行权限的例子
- 一个很有意思的java代码例子
- NDK的一个简单例子代码
- 重构代码的一个例子
- Base64Code.h
- Base64Code.cpp
- 一个完整的分页显示代码的例子
- NSNotificationCenter 用法 一个简单的使用 NSNotificationCenter 的代码例子
- Android代码混淆的一个常用的简单例子
- 一个简单的打印HttpServletRequest头jsp代码例子
- OpenOffice Calc开发(C++) 7 一个例子的代码详解
- 过程抽象和返回一个值的函数(例子代码)
- 一个OpenGL ES 的简单使用例子代码
- 一种解决一维数组旋转问题的方法
- 使用加速器实现的定位算法
- 算法竞赛入门经典 3.3 最长回文子串
- DELPHI基础:DELPHI中IDE环境的设置
- JAVA多线程,面试者的最爱!(转)
- base64code 的一个例子代码
- 在ubuntu上安装maven3
- so hurted
- 浅谈merge join 与hash join的区别
- colorMatrix
- 【并查集】小希的迷宫
- 锁定内存页
- 由UIview获得其controller
- xml解析(DOM)