#include <cstdio>
#include <curl.h>
#include <cstring>
#include <cstdlib>
#include <types.h>
#include <easy.h>
#pragma comment(lib,"libcurl_imp.lib")
int _tmain(int argc, _TCHAR* argv[])
{
curl_global_init(CURL_GLOBAL_ALL);
CURL *myHandle=curl_easy_init();
curl_easy_setopt(myHandle,CURLOPT_USERAGENT,"Mozilla/4.0");
curl_easy_setopt(myHandle,CURLOPT_AUTOREFERER,1);
curl_easy_setopt(myHandle,CURLOPT_FOLLOWLOCATION,1);
curl_easy_setopt(myHandle,CURLOPT_COOKIEFILE,"");
curl_easy_setopt(myHandle,CURLOPT_URL,"http://www.3322.org/dyndns/login");
curl_easy_perform(myHandle);
//更新串需要用wireshark抓包,然后查看请求串,然后做相应的更改
char *data="username=帐号&actiong=login&password=密码&submit=%E7%99%BB%E5%BD%95&action=login";
char *update="hostname=需要更新域名&myip=要更新域名IP&mx=&backmx=NO&wildcard=OFF&offline=NO&act=mod&modflag=modflag";
curl_easy_setopt(myHandle,CURLOPT_POSTFIELDS,data);
curl_easy_perform(myHandle);
curl_easy_setopt(myHandle,CURLOPT_URL,"http://www.3322.org/dyndns/chrrs");
curl_easy_setopt(myHandle,CURLOPT_POSTFIELDS,update);
curl_easy_perform(myHandle);
curl_easy_cleanup(myHandle);
return 0;
}
用libcurl实现3322域名更新
最新推荐文章于 2022-12-05 09:08:48 发布