刷网易博客访问量

 1 #include <iostream>
 2 #include <urlmon.h>
 3 #pragma comment(lib, "urlmon.lib")
 4 #define MAX 4294967295
 5 using namespace std;
 6 void main()
 7 {
 8     bool flag=true;
 9     unsigned int i;
10     LPCSTR szURL[5],szFileName="1.txt";
11     szURL[0]="http://d-zq.blog.163.com/";
12     szURL[1]="http://d-zq.blog.163.com/blog/static/2011492712011112464136722/";
13     szURL[2]="http://d-zq.blog.163.com/blog/static/20114927120111124585462/";
14     szURL[3]="http://d-zq.blog.163.com/blog/static/2011492712011112443414616/";
15     szURL[4]="http://d-zq.blog.163.com/blog/static/20114927120111122105542624/";
16     for(i=0;i<MAX&&flag;i++)
17     {
18         for (int j=0;j<5;j++)
19         {
20             if(URLDownloadToFile( NULL,szURL[j],szFileName,0,NULL)==S_OK)
21             {
22                 
23                 cout<<"成功访问 "<<i<<""<<endl;
24             }
25             else{
26                 cout<<"访问失败"<<endl;
27                 flag=false;
28                 break;
29             }
30         }
31         system("cls");
32     }
33 }

不想多说,想用的话自己拷贝代码,编译运行。

原文地址:https://www.cnblogs.com/dzqdzq/p/3014825.html