当前位置:网站首页>54.【system系统互动函数大总结】
54.【system系统互动函数大总结】
2022-08-02 17:36:00 【李在奋斗……】
《system函数调用关机》
#include <iostream>
#include <stdlib.h> //调用system函数的头文件
#include <string>
using namespace std;
int main()
{
char s[100];
system("shutdown -s -t 120"); //这里用的是电脑自动关机的程序
while (1)
{
cout << "你的电脑将会在2分钟内自动关机:" << endl;
cout << "如果想取消自动关机,请输入:李威涛是我爹" << endl;
cin >> s;
if (strcmp(s, "傻瓜")==0) //判断的是:左边的是否等于右边
{
cout << "预计在两分钟后的自动关机已取消:" << endl;
system("shutdown -a"); //取消自动关机小程序
break;
}
}
return 0;
}
========================================
《system调用颜色》
0 = 黑色 8 = 灰色?
1 = 蓝色 9 = 淡蓝色
2 = 绿色 A = 淡绿色?
3 = 浅绿色 B = 淡浅绿色
4 = 红色 C = 淡红色
5 = 紫色 D = 淡紫色?
6 = 黄色 E = 淡黄色
7 = 白色 F = 亮白色?
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
system("color 01"); //左边为背景,右边为字体
return 0;
}
========================================
《system调用暂停系统》
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
int main()
{
string s;
cout<<"我喜欢!"<<endl;
cin>>s;
system("pause"); //暂停后面的一切语句
cout<<s;
return 0;
}
========================================
《system调用日期 》
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout<<"现在的时间为:"<<endl;
system("DATE"); //显示日期并设置日期
//system("DATE/t") //显示日期
return 0;
}
========================================
《system调用电脑记事本》
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout<<"调用电脑的记事本"<<endl;
system("notepad");
return 0;
}
========================================
《syste调用计算器》
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout<<"调用计算器:"<<endl;
system("calc");
return 0;
}
========================================
《system更改标题》
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout<<"更改标题名称:"<<endl;
system("title 傻瓜");
return 0;
}
========================================
《system调用待处理文件》
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout<<"调用计算器:"<<endl;
system("calc");
cout<<"调用电脑的记事本"<<endl;
system("notepad");
cout<<"调用待处理文件:"<<endl;
system("comend.bat"); //首先创建.bat 然后进行编辑
return 0;
}
========================================
《system调用脚本》
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout<<"运行脚本:"<<endl;
system("表白.vbs"); //首先创建一个文本文档,后缀改成.vbs
return 0;
}
边栏推荐
- Redis总结_实战篇
- redis总结_多级缓存
- 记一次 .NET 某工控自动化控制系统 卡死分析
- 究极异常处理逻辑——多层次异常的处理顺序
- [C Language Brush Questions] Three Questions for Getting Started with Pointers | String Length, String Copy, Two Number Swap
- 电烙铁的基础知识
- docker安装Oracle之后常用的一些命令
- Informatica旗下PowerCenter的元数据库解析
- 一朵“云“如何带来产业新变革
- 小程序毕设作品之微信体育馆预约小程序毕业设计成品(6)开题答辩PPT
猜你喜欢
AI+医疗:使用神经网络进行医学影像识别分析
基于HDF的LED驱动程序开发(1)
IReport常见问题及处理方法
方法的使用
小程序毕设作品之微信体育馆预约小程序毕业设计成品(6)开题答辩PPT
MySQL基本操作和基于MySQL基本操作的综合实例项目
用函数递归的方法解决汉诺塔问题
golang学习之七:并发编程基础(goroutine、channel、select)
HDF驱动框架的API(3)
Wechat Gymnasium Appointment Mini Program Graduation Design Finished Works Mini Program Graduation Design Finished Work (6) Question Opening Reply PPT
随机推荐
Since September, China has granted zero-tariff treatment to 98% of tax items from 16 countries including Togo
HDF驱动框架的API(3)
redis总结_分布式缓存
golang源码分析(12)martini源码分析
文件上传很难搞?10分钟带你学会阿里云OSS对象存储
启航
NeRF:火爆科研圈的三维重建技术大揭秘
在线文档Sheet技术解析
字节面试官狂问我:你没有高并发、性能调优经验,为什么录取你?
How Tencent architects explained: The principle of Redis high-performance communication (essential version)
golang源码阅读(11)GO中各个目录的功能
研发运营一体化(DevOps)能力成熟度模型
Smart Contract Security - delegatecall (1)
golang源码分析(2):Golang context 包
MySQL基本查询和运算符
谁抢走了华大基因的生意?
How a "cloud" can bring about new changes in the industry
牛津硕士进碳圈,高瓴红杉经纬一起投了
golang源码分析(10)slice
Kubernetes:(七)优化大法(江湖失传已久的武林秘籍)