
功能介紹使用cmd的taskkill指令強制結束StudentMain.exe達到脫離老師控制的目的。代碼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, 結束失敗目標進程不存在, 一鍵脫控, MB_ICONWARNING | MB_OK); } else { stringstream b; b 未知錯誤退出碼 a; string c b.str(); MessageBox(NULL, c.c_str(), 一鍵脫控, MB_ICONERROR | MB_OK); } return 0; }bat批處理指令taskkill /im StudentMain.exe /f pause