摘要:
1 BOOL KFunction::HttpPostData( LPCTSTR strUrl,LPCTSTR strData ) 2 { 3 OutputDebugString(_T("URL:")); 4 OutputDebugString(strUrl); 5 OutputDebugString(_T("DATA:")); 6 OutputDebugString(strData); 7 bool bRtn = true; 8 HINTERNET hSession = NULL; 9 HINTERNET hConn = NULL;10... 阅读全文
摘要:
1 int URLEncode( const CString& rawStr,CString& encodeStr ) 2 { 3 #ifdef _UNICODE 4 std::string strPre = wstring2string((LPCTSTR)rawStr).c_str(); 5 std::string strEncoded; 6 char* szHexTable = "0123456789ABCDEF", 7 * szUnsafeTable = "\"%\\^[]`+$,@:;/!#?=&" ; 8 fo 阅读全文
摘要:
1 bool GetMD5(LPCTSTR lpsz,const int strLen,LPTSTR lpMD5,const int bufLen) 2 { 3 memset(lpMD5,0,bufLen); 4 5 int mbStrLen = WideCharToMultiByte(CP_UTF8,0,lpsz,strLen,NULL,0,NULL,NULL); 6 CHAR* mbStr = new CHAR[mbStrLen+1]; 7 memset(mbStr,0,mbStrLen+1); 8 WideCharToMultiByte(CP_... 阅读全文
摘要:
1 std::string wstring2string(const std::wstring& wstr) 2 { 3 int bufLen = WideCharToMultiByte(CP_UTF8,0,wstr.c_str(),-1,NULL,0,NULL,NULL); 4 char* strbuf = new char[bufLen]; 5 WideCharToMultiByte(CP_UTF8,0,wstr.c_str(),-1,strbuf,bufLen,NULL,NULL); 6 std::string temp(strbuf); 7 d... 阅读全文
摘要:
卸载程序不仅仅把其他软件相关文件和记录删掉,难点在于怎样将自己删除,网上也有很多关于自删除的文章,不错这里有个更简单的方法。 1.程序启动时检查命令行参数,如果为空则将当前执行程序复制的用户临时目录下,并记住该路径。 2.用以特定命令行参数启动临时目录下的执行程序,自身退出,注意在这个过程中不会有任何界面。 3.临时目录下的执行程序开始执行,这次检查到命令行含有制定的参数(上一步传过来的),开始执行卸载,这样就可以直接将软件安装目录下的所有文件全删掉了。 阅读全文