最近总是受到莫名的手机骚扰,便想弄一个查手机号所在地的程序,在网上翻了好久终于在http://mobile.zol.com.cn/search.php找到一个,但这是web的用起来不方便,如果能把db下载到本地多好啊,这难不倒我这个程序员的,打开ieHTTPHeaders这个工具,然后跟踪了一下,得到下面的结果:
POST http://mobile.zol.com.cn/search.php HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*
Referer: http://mobile.zol.com.cn/search.php
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Proxy-Connection: Keep-Alive
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
Host: mobile.zol.com.cn
Content-Length: 75
Pragma: no-cache
status=search&searchkeyword=13066666168&searchcategory=&Submit=%CB%D1%CB%F7
HTTP/1.1 200 OK
Via: 1.0 MSPROXY2
Date: Tue, 25 May 2004 00:27:23 GMT
Content-Type: text/html; charset=gb2312
Server: Apache
X-Powered-By: PHP/4.3.4RC1
X-Cache: MISS from squid3.zol.com.cn
这就好办了,不就是HTTP协议吗,post一些数据,然后再做request,下面是我写的程序:
http://www.cnblogs.com/jjstar/articles/11251.aspx
下班后启动程序,打开9个线程发飙了一吧,,结果还是很不错的。