
功能介紹使用cmd的taskkill指令強(qiáng)制結(jié)束StudentMain.exe達(dá)到脫離老師控制的目的。代碼C代碼最直觀最好#includeiostream #includewindows.h #includesstream using namespace std; int main() { ShowWindow(GetConsoleWindow(), SW_HIDE); int a system(taskkill /im StudentMain.exe /f); if(a 0) { MessageBox(NULL, 脫控成功, 一鍵脫控, MB_ICONINFORMATION | MB_OK); } else if (a 128) { MessageBox(NULL, 結(jié)束失敗目標(biāo)進(jìn)程不存在, 一鍵脫控, MB_ICONWARNING | MB_OK); } else { stringstream b; b 未知錯(cuò)誤退出碼 a; string c b.str(); MessageBox(NULL, c.c_str(), 一鍵脫控, MB_ICONERROR | MB_OK); } return 0; }bat批處理指令taskkill /im StudentMain.exe /f pause