C++复制#include <iostream> #include <windows.h> #include <cstdlib> int main() { system("color 0b"); SetConsoleTitle("关机阻止卫士"); std::cout<<"正在阻止关机\n"; Sleep(700);//等待时间:1毫秒 while(true){ system("shutdown -a"); Sleep(1);//等待时间:1毫秒 } return 0; }