电脑控制面板代码(AC狗原创)
2026-02-16 19:22:12
发布于:湖北
转载带上作者的名字,谢谢,欢迎提议
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
void setColor(int color) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
}
void showHelp() {
setColor(11);
cout << "╔════════════════════════════════════╗" << endl;
cout << "║ 可用指令列表 ║" << endl;
cout << "╠════════════════════════════════════╣" << endl;
cout << "║ 打开记事本 - 打开记事本 ║" << endl;
cout << "║ 打开计算器 - 打开计算器 ║" << endl;
cout << "║ 打开浏览器 - 打开Chrome浏览器 ║" << endl;
cout << "║ 新建文件夹 - 创建新文件夹 ║" << endl;
cout << "║ 显示时间 - 显示日期和时间 ║" << endl;
cout << "║ 关机 - 系统关机 ║" << endl;
cout << "║ 取消关机 - 取消计划关机 ║" << endl;
cout << "║ 重启 - 重启系统 ║" << endl;
cout << "║ 杀毒 - 执行病毒扫描 ║" << endl;
cout << "║ 快速扫描 - 快速病毒扫描 ║" << endl;
cout << "║ 完整扫描 - 完整病毒扫描 ║" << endl;
cout << "║ 帮助 - 显示本帮助信息 ║" << endl;
cout << "║ 退出 - 退出程序 ║" << endl;
cout << "╚════════════════════════════════════╝" << endl;
setColor(7);
}
void shutdownSystem() {
setColor(12);
cout << "\n[警告] 系统将在60秒后关机!" << endl;
cout << "输入 '取消关机' 可以取消关机操作" << endl;
setColor(7);
system("shutdown /s /t 60 /c \"系统将在60秒后关机\"");
}
void restartSystem() {
setColor(12);
cout << "\n[警告] 系统将在60秒后重启!" << endl;
cout << "输入 '取消关机' 可以取消重启操作" << endl;
setColor(7);
system("shutdown /r /t 60 /c \"系统将在60秒后重启\"");
}
void cancelShutdown() {
system("shutdown /a");
setColor(10);
cout << "[成功] 已取消计划中的关机/重启操作" << endl;
setColor(7);
}
void virusScan(string scanType = "快速") {
setColor(14);
cout << "\n[扫描] 开始" << scanType << "病毒扫描..." << endl;
cout << "=================================" << endl;
setColor(7);
cout << "\n[系统] 检查系统文件..." << endl;
system("sfc /scannow > nul 2>&1 & echo 系统文件检查完成");
cout << "\n[启动] 检查启动项..." << endl;
system("wmic startup get caption,command");
cout << "\n[进程] 检查可疑进程..." << endl;
const char* suspicious[] = {
"taskmgr.exe", "procexp.exe", "ollydbg.exe",
"x64dbg.exe", "wireshark.exe", "ida.exe"
};
int suspiciousCount = sizeof(suspicious) / sizeof(suspicious[0]);
for(int i = 0; i < suspiciousCount; i++) {
string cmd = "tasklist | findstr /i \"" + string(suspicious[i]) + "\"";
if(system(cmd.c_str()) == 0) {
setColor(12);
cout << "[发现] 可疑进程: " << suspicious[i] << endl;
setColor(7);
}
}
cout << "\n[临时] 检查临时文件夹..." << endl;
system("dir C:\\Windows\\Temp /a /b | find /c /v \"\" > temp.txt");
ifstream tempFile("temp.txt");
int tempCount = 0;
tempFile >> tempCount;
tempFile.close();
system("del temp.txt");
cout << "临时文件数量: " << tempCount << endl;
cout << "\n[网络] 检查网络连接..." << endl;
system("netstat -an | find /c \"ESTABLISHED\" > connections.txt");
ifstream connFile("connections.txt");
int connections = 0;
connFile >> connections;
connFile.close();
system("del connections.txt");
cout << "当前网络连接数: " << connections << endl;
if(scanType == "完整") {
cout << "\n[深度] 执行完整扫描..." << endl;
system("dir C:\\ /s /b > filelist.txt 2>nul");
cout << "已生成文件列表,正在分析..." << endl;
system("findstr /i \".exe .dll .scr .vbs\" filelist.txt > suspicious_files.txt");
ifstream susFile("suspicious_files.txt");
string line;
int susCount = 0;
while(getline(susFile, line) && susCount < 10) {
cout << "检查: " << line << endl;
susCount++;
}
susFile.close();
system("del filelist.txt 2>nul");
system("del suspicious_files.txt 2>nul");
}
setColor(10);
cout << "\n[完成] " << scanType << "病毒扫描完成!" << endl;
if(connections > 100) {
setColor(12);
cout << "[警告] 网络连接数异常!" << endl;
}
if(tempCount > 1000) {
setColor(12);
cout << "[警告] 临时文件过多!" << endl;
}
setColor(7);
}
void quickScan() {
virusScan("快速");
}
void fullScan() {
virusScan("完整");
}
int main() {
SetConsoleTitle("智能指令系统 v2.0");
system("mode con cols=100 lines=40");
string command;
setColor(10);
cout << "╔════════════════════════════════════╗" << endl;
cout << "║ 智能指令系统 ║" << endl;
cout << "╚════════════════════════════════════╝" << endl;
cout << " 请输入指令:" << endl;
cout << "=====================================" << endl << endl;
setColor(7);
while(true) {
setColor(11);
cout << ">>> ";
setColor(7);
getline(cin, command);
if(command == "打开记事本") {
cout << "[执行] 正在打开记事本..." << endl;
system("notepad.exe");
}
else if(command == "打开计算器") {
cout << "[执行] 正在打开计算器..." << endl;
system("calc");
}
else if(command == "打开浏览器") {
cout << "[执行] 正在打开Chrome浏览器..." << endl;
system("start chrome.exe");
}
else if(command == "新建文件夹") {
cout << "[执行] 正在创建文件夹..." << endl;
system("mkdir folder 2>nul");
if(system("dir folder 2>nul") == 0) {
cout << "[成功] 文件夹创建成功!" << endl;
} else {
system("mkdir folder");
}
}
else if(command == "显示时间") {
cout << "[信息] 当前系统时间:" << endl;
system("date /t");
system("time /t");
}
else if(command == "关机") {
shutdownSystem();
}
else if(command == "重启") {
restartSystem();
}
else if(command == "取消关机") {
cancelShutdown();
}
else if(command == "杀毒" || command == "快速扫描") {
quickScan();
}
else if(command == "完整扫描") {
fullScan();
}
else if(command == "帮助") {
showHelp();
}
else if(command == "退出") {
setColor(10);
cout << "\n[退出] 程序退出,再见!" << endl;
setColor(7);
break;
}
else if(command == "cls" || command == "清屏") {
system("cls");
}
else if(command == "") {
continue;
}
else {
setColor(12);
cout << "[错误] 未知指令:" << command << endl;
cout << "输入 '帮助' 查看可用指令" << endl;
setColor(7);
}
cout << endl;
Sleep(500);
}
/*
║ 打开记事本 - 打开记事本 ║
║ 打开计算器 - 打开计算器 ║
║ 打开浏览器 - 打开Chrome浏览器 ║
║ 新建文件夹 - 创建新文件夹 ║
║ 显示时间 - 显示日期和时间 ║
║ 关机 - 系统关机 ║
║ 取消关机 - 取消计划关机 ║
║ 重启 - 重启系统 ║
║ 杀毒 - 执行病毒扫描 ║
║ 快速扫描 - 快速病毒扫描 ║
║ 完整扫描 - 完整病毒扫描 ║
║ 帮助 - 显示本帮助信息 ║
║ 退出 - 退出程序 ║
*/
return 0;
}
这里空空如也



















有帮助,赞一个