摘要: 1.概念在C/C++中,对字符串的操作有很多值得注意的问题,同样,C/C++对时间的操作也有许多值得大家注意的地方。最近,在技 术群中有很 多网友也多次问到过C++语言中对时间的操作、获取和显示等等的问题。下面,在这篇文章中,笔者将主要介绍在C/C++中时间和日期的使用方法.通过学习许多C/C++库,你可以有很多操作、使用时间的方法。但在这之前你需要了解一些“时间”和“日期”的概念,主要有以下几个:Coordinated Universal Time(UTC):协调世界时,又称为世界标准时间,也就是大家所熟知的格林威治标准时间(Greenwich Mean Time,GMT)。比如,中国内地的 阅读全文
posted @ 2012-05-25 10:46 大约 阅读(484) 评论(0) 推荐(0) 编辑
摘要: CURLE_UNSUPPORTED_PROTOCOL (1) – 您传送给 libcurl 的网址使用了此 libcurl 不支持的协议。 可能是您没有使用的编译时选项造成了这种情况(可能是协议字符串拼写有误,或没有指定协议 libcurl 代码)。CURLE_FAILED_INIT (2) - 非常早期的初始化代码失败。 可能是内部错误或问题。CURLE_URL_MALFORMAT (3) - 网址格式不正确。CURLE_COULDNT_RESOLVE_PROXY (5) - 无法解析代理服务器。 指定的代理服务器主机无法解析。CURLE_COULDNT_RESOLVE_HOST (6) – 阅读全文
posted @ 2012-05-24 12:49 大约 阅读(6201) 评论(0) 推荐(0) 编辑
摘要: 下载libcurl的源码,打开lib文件夹下项目,编译为静态链接库。在编译的时候出现问题如下:注:以前在vc2005下用mfc工程并且libcurl用的dll方式没问题,这次vc2008用的sdk并且libcurl用的静态编译,也不知道什么问题引起的HttpWebRequest.obj : error LNK2001: 无法解析的外部符号 __imp__curl_slist_free_all1>HttpWebRequest.obj : error LNK2001: 无法解析的外部符号 __imp__curl_easy_cleanup1>HttpWebRequest.obj : er 阅读全文
posted @ 2012-05-19 12:41 大约 阅读(23145) 评论(1) 推荐(1) 编辑
摘要: // HttpPost.cpp written by l_zhaohui@163.com// 2007/11/30#include <windows.h>#include <stdio.h>#include <stdlib.h>#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS#include <atlbase.h>#include <atlstr.h>#define USE_WINHTTP //Comment this line to user wininet.#ifdef USE_WINHTTP# 阅读全文
posted @ 2012-05-18 16:30 大约 阅读(1544) 评论(1) 推荐(0) 编辑
摘要: std::string Conductor::LetterToUper(std::string input){ for(int i=0;i<input.length();i++) { if(input[i]>='a'&&input[i]<='z') input[i]-=32; else if (input[i]>='A'&&input[i]<='Z')input[i]+=32; } return input;} 阅读全文
posted @ 2012-05-09 13:49 大约 阅读(4210) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string>using namespace std;int main(void){ char str[]="hello";//方法1 string ss1(str);//方法2 string ss2; ss2=str;//方法3 string ss3; ss3.insert(0,str); cout<<ss1<<endl<<ss2<<endl<<ss3<<endl;return 0;} 阅读全文
posted @ 2012-05-09 11:17 大约 阅读(8478) 评论(0) 推荐(0) 编辑
摘要: #ifndef _ZBASE64#define _ZBASE64#pragma warning(disable:4786) #include <string>using namespace std;class ZBase64{private://Base64编码解码表char* m_Base64_Table;public://构造ZBase64();//编码string EncodeBase64(const string strSource);//解码string DecodeBase64(const string strSource);};#endif#include " 阅读全文
posted @ 2012-05-07 12:25 大约 阅读(1013) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include "../src/utility/md5.h"void main(){ SHA1 sha1; char buffer[41]; sha1.SHA_GO("a",buffer); printf("%s",buffer); //sha1调用//=================================================== //MD5调用 std::string str = "abc"; MD5 md5(str); std::str 阅读全文
posted @ 2012-05-07 11:44 大约 阅读(5400) 评论(1) 推荐(0) 编辑
摘要: #include "http://www.cnblogs.com/src/network/http.h"void WinHttpWorker::HttpCreateSession(LPCWSTR agent){ _hSession=WinHttpOpen(agent,WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,WINHTTP_NO_PROXY_NAME,WINHTTP_NO_PROXY_BYPASS,0); if(_hSession) { printf("%s", "_hSession\n"); }}void 阅读全文
posted @ 2012-05-07 10:04 大约 阅读(1047) 评论(0) 推荐(0) 编辑
摘要: #include <string>#include <iostream>#include <windows.h>#include <winhttp.h>#pragma comment(lib,"winhttp.lib")#pragma comment(lib,"user32.lib")void main(){ DWORD dwSize = 0; DWORD dwDownloaded = 0; LPSTR pszOutBuffer = NULL; HINTERNET hSession = NULL, hCon 阅读全文
posted @ 2012-05-05 16:33 大约 阅读(10771) 评论(1) 推荐(1) 编辑