#include <iostream.h> #include <windows.h> #include <tchar.h> void EncodeString(LPCTSTR lpszText, LPTSTR *lpszReturn, LPCTSTR lpszKey) { int nTextLen = 0; char *cPos = NULL; char *pDest = NULL; if(!lpszReturn) // 加密 { nTextLen = ::_tcslen(lpszText); pDest = (LPTSTR)lpszText; } else // 解密 { // 查找自定的中止标记 cPos = (LPTSTR)lpszText; while(true) // 从这里可以看到,除非搜索到我们自定的中止标记,否则会一直搜索下去 { if(*cPos == '=') if(cPos[1] == '=') if(cPos[2] == '