#include <stdio.h>
#include <GeoIP.h>
int main()
{
GeoIP *gi;
gi = GeoIP_new(GEOIP_STANDARD);
printf("yahoo.com belong to --%s--\n", GeoIP_country_code_by_name(gi, "yahoo.com"));
printf("sina.com.cn belong to --%s--\n", GeoIP_country_code_by_name(gi, "sina.com"));
printf("groad.net belong to --%s--\n", GeoIP_country_code_by_name(gi, "groad.net"));
printf("mofa.go.jp belong to --%s--\n", GeoIP_country_code_by_name(gi, "web-japan.org"));
return 0;
}
$ ./simple
yahoo.com belong to --US--
sina.com.cn belong to --US--
groad.net belong to --CN--
mofa.go.jp belong to --JP--
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |