最近宿舍一同学开了个淘宝店,想刷一下访问量,于是就百度了一下有没有打开网站和关闭网站的操作。
于是就有了下面的代码:
#include <windows.h>
#include <time.h>
int main(){
time_t a, b;
time_t start = time(NULL);
while( a = time(NULL)){
if( a-start<5)
system("C:\\Users\\Administrator\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe\ http://shop70565027.taobao.com/");
//这里把你的谷歌浏览器的地址位置放进来 记得要把\改成\\ 然后就可以了!
else
break;
}
while( b = time(NULL)){
if(b-a>10){
system("TASKKILL /F /IM chrome.exe");
break;
}
}
return 0;
}
就是调用系统用浏览器打开网页 循环一段时间后 再关闭浏览器.