C++#include<bits/stdc++.h>
#define int long long
#ifdef DEVC
#define INIT_FILE_IO(name) freopen("1.txt","r",stdin);
#define INIT_FILE_IOF() freopen("1.txt","r",stdin);
#else
#define INIT_FILE_IO(name) freopen(name".in","r",stdin);freopen(name".out","w",stdout);ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define INIT_FILE_IOF() ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#endif
#define endl '\n'
#define wb " "
//文件操作//-O2 -std=c++14 -static -DDEVC
using namespace std;
signed main(){
if(wb[0]==' '){INIT_FILE_IOF();}else{INIT_FILE_IO(wb);}
return 0;
}
哈哈哈,极域课堂管理系统软件掉
C++#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
// 检测任意键盘/鼠标按下,除按鼠标中键
bool AnyInputPressed(){
if((GetAsyncKeyState(VK_LBUTTON) & 0x8000)||(GetAsyncKeyState(VK_RBUTTON) & 0x8000) || (GetAsyncKeyState(VK_MBUTTON) & 0x8000))return true;
for(int key = 8; key <= 254; key++)if(GetAsyncKeyState(key) & 0x8000)return true;
return false;
}
signed main(){
cin.tie(0);cout.tie(0);
while(1){
int r=system("tasklist | findstr /i StudentMain.exe >nul 2>&1");
if((GetAsyncKeyState(VK_MBUTTON) & 0x8000)&&r){//按鼠标中键
system("start \"\" \"C:\\Program Files (x86)\\Mythware\\极域课堂管理系统软件v6.0 2020豪华版\\StudentMain.exe\"");
cout<<"开起成功\n";
}
if(!r){
cout<<"检测到 StudentMain.exe,2秒后强制关闭,按任意键鼠取消\n";
bool cancel = false;
for(int i=2;i>=1 && !cancel;i--){
cout<<i<<" 秒\n";
for(int t=1;t<=10;t++){
if(AnyInputPressed()){
cancel = true;
break;
}
Sleep(2);
}
}
if(!cancel){
system("taskkill /f /im StudentMain.exe >nul 2>&1");
cout<<"倒计时结束,关闭程序\n";
}else{
cout<<"已取消关闭操作\n";
}
}
}
return 0;
}