
16.04.2010, 16:29
|
|
Участник форума
Регистрация: 11.09.2008
Сообщений: 107
С нами:
9296442
Репутация:
21
|
|
Код:
HINSTANCE cl = NULL;
if( ( cl = LoadLibrary( "libcurl.dll" ) ) == NULL )
MessageBox(NULL, "I can't load libcurl","ERROR", 0);
TRegExpr *RegExpr = new TRegExpr;
String cookiefile;
CURL *curl;
String table;
String url;
curl = curl_easy_init();
url=Edit1->Text;
if(url=="")
url="mail.yahoo.com";
if(curl) {
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,Writer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA,&table);
curl_easy_setopt(curl, CURLOPT_URL,url);
curl_easy_setopt(curl, CURLOPT_HEADER , 1 );
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, cookiefile);
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, cookiefile);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_perform(curl);
curl_easy_cleanup(curl);
RegExpr->Expression="#\<meta(.*?)\>#";
if(RegExpr->Exec(table))
Label1->Caption =RegExpr->ErrorMsg(RegExpr->LastError());
Label1->Caption =RegExpr->Match[0];
}
FreeLibrary(cl);
}
Может дело в регулярках т.к. писал регулярки как в php могу предположить что синтаксис здесь другой используеться.
|
|
|