Hello,我是老六工作室,今天我们继续来编辑我们的C++ Windows。
我们来看一下之前的代码:
#define n1 532
#define D 250
#include<iostream>
#include<windows.h>
using namespace std;
void sound()
{
Beep(n1,D);
}
int setting()
{
cout<<"设置 Setting"<<endl;
cout<<"1:停止运行Windows C++"<<endl;
cout<<"2:参数"<<endl;
cout<<"3:关闭设置"<<endl;
int a;
cin>>a;
switch (a)
{
case 1:
{
cout<<"停止Windows C++运行中...";
_sleep(1000);
return 0;
}
case 2:cout<<"【老六工作室】制作"<<endl;
}
return 0;
}
int main()
{
system("title Windows C++");
cout<<"Opening";
cout<<".";
_sleep(100);
cout<<".";
_sleep(100);
cout<<".";
_sleep(100);
string username;
cout<<endl;
cout<<"欢迎使用~"<<endl;
cout<<"[初始化1/2]请输入用户名:";
cin>>username;
string password;
cout<<"[初始化2/2]请输入密码:";
cin>>password;
int len=password.length();
while(len<6){
cout<<"请重新输入(6位以上):";
cin>>password;
len=password.length();
}
return 0;
}
下面我们来编辑使用手册。
void user_handbook()
{
cout<<"O键打开,W键关闭,C键复制,V键粘贴,U键向上,D键向下。"<<endl;
_sleep(2000);
}
很短吧?
继续继续,来一个浏览器:
system("start https://baidu.com");
因为它太短,所以暂且把它放在一边(最后程序):
#define n1 532
#define D 250
#include<iostream>
#include<windows.h>
using namespace std;
void sound()
{
Beep(n1,D);
}
int setting()
{
cout<<"设置 Setting"<<endl;
cout<<"1:停止运行Windows C++"<<endl;
cout<<"2:参数"<<endl;
cout<<"3:关闭设置"<<endl;
int a;
cin>>a;
switch (a)
{
case 1:
{
cout<<"停止Windows C++运行中...";
_sleep(1000);
return 0;
}
case 2:cout<<"【老六工作室】制作"<<endl;
}
return 0;
}
void user_handbook()
{
cout<<"O键打开,W键关闭,C键复制,V键粘贴。"<<endl;
_sleep(2000);
}
int main()
{
system("title Windows C++");
cout<<"Opening";
cout<<".";
_sleep(100);
cout<<".";
_sleep(100);
cout<<".";
_sleep(100);
string username;
cout<<endl;
cout<<"欢迎使用~"<<endl;
cout<<"[初始化1/2]请输入用户名:";
cin>>username;
string password;
cout<<"[初始化2/2]请输入密码:";
cin>>password;
int len=password.length();
while(len<6){
cout<<"请重新输入(6位以上):";
cin>>password;
len=password.length();
}
//system("start https://baidu.com"); 浏览器
return 0;
}
好了,今天就编辑到这里,我们C++模拟Windows系统(第5集)再见~