使用一个笨方法去完成CSDN博客的阅读数增加,话不多说上代码
#include <windows.h>
#include <tchar.h>
#include <assert.h>
const TCHAR szOpen[] = _T("open");
const TCHAR szAddress1[] = _T("https://blog.csdn.net/SherlockHolmess/article/details/87875558");
int main()
{
while(1)
{
HINSTANCE hRslt1 = ShellExecute(NULL, szOperation, szAddress1, NULL, NULL, SW_SHOWNORMAL);
assert(hRslt1 > (HINSTANCE)HINSTANCE_ERROR);
Sleep(60000); //延时60000ms
system("TASKKILL /f /im chrome.exe"); //关闭chrome.exe进程树
}
return 0;
}
实现方法是通过默认浏览器去完成,使用系统的API函数完成访问网站和关闭chrome.exe进程树。