只需要curl_easy_perform之前做操作,
写cookies:curl_easy_setopt(pCurl, CURLOPT_COOKIEJAR, g_strCookiesFilePath.c_str());
读cookies:curl_easy_setopt(pCurl, CURLOPT_COOKIEFILE, g_strCookiesFilePath.c_str());
if(_ct_read_cookies_ == (ct & _ct_read_cookies_))
{
curl_easy_setopt(pCurl, CURLOPT_COOKIEFILE, g_strCookiesFilePath.c_str());
}
if(_ct_write_cookies_ == (ct & _ct_write_cookies_))
{
curl_easy_setopt(pCurl, CURLOPT_COOKIEJAR, g_strCookiesFilePath.c_str());
}
nRet = curl_easy_perform(pCurl);