#include<iostream>
#include<stdio.h>
#include<conio.h>
#include<regex>
#include<string>
#include<windows.h>
#include<mmsystem.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
/*调整框体***********************/
//system+do指令
//标题名 title 标题
//颜色 color f0
//大小 mod con cols=? lines=?
/********************************/
void proc()
{
string str("▇☆▇ ");
for(double i=0;i<=40;i++)
{
system("cls");
cout<<str<<endl;
cout<<i*2.5<<"%"<<endl;
str+="▇☆▇ ";
Sleep(200);
}
}
void setwindowstyle()
{
system("title 木木的家");
system("color f0");
system("mode con cols=40 lines=8");
}
bool checkemail(char*username)
{
//ydpatjj @网页链接 regex object("(\\w+)@(\\w+)(\\.(\\w+))+");
/***************************/
//字母a-z A-Z或者数字0-9或者下划线
//+
bool result=regex_match(username,object);
return result;
}
int main()
{
setwindowstyle();
/**********************/
//用户名和密码
char username[20]="";
char password[10]="";
cout <<"\t用户名:";
cin >> username;
cout <<"\t密 码:";
/**********************/
//密码不可见
//_getch()不可见输入头文件为#include<conio.h>
char key;
int i=0;
while((key=_getch())!='\r')
{
if(i<9)
{
password[i++]=key;
putchar('*');
}
else
{
cout<<"密码过长"<<endl;
system("pause");
return 0;
}
}
//字符串结束标志;\0
password[i]='\0';
cout<<endl;
//cin>>password;
if(checkemail(username))
{
cout<<"\t"<<username<<"是邮箱"<<endl;
if(!strcmp(username,"3439640879@qq.com")&&!strcmp(password,"123456"))
{
proc();
printf("登陆成功!!!!!");
system("pause");
return 0;
//弹出进度条
//播放音乐
cout<<"欢迎主人回家!!!"<<endl;
mciSendString("opean 1.mp3 alias music",0,0,0);
mciSendString("piay music repeat",0,0,0);
}
else
{
cout<<"用户名或密码错误"<<endl;
}
}
else
{
cout<<"\t"<<username<<"不是邮箱"<<endl;
}
system("pause");
return 0;
}
#include<stdio.h>
#include<conio.h>
#include<regex>
#include<string>
#include<windows.h>
#include<mmsystem.h>
#pragma comment(lib,"winmm.lib")
using namespace std;
/*调整框体***********************/
//system+do指令
//标题名 title 标题
//颜色 color f0
//大小 mod con cols=? lines=?
/********************************/
void proc()
{
string str("▇☆▇ ");
for(double i=0;i<=40;i++)
{
system("cls");
cout<<str<<endl;
cout<<i*2.5<<"%"<<endl;
str+="▇☆▇ ";
Sleep(200);
}
}
void setwindowstyle()
{
system("title 木木的家");
system("color f0");
system("mode con cols=40 lines=8");
}
bool checkemail(char*username)
{
//ydpatjj @网页链接 regex object("(\\w+)@(\\w+)(\\.(\\w+))+");
/***************************/
//字母a-z A-Z或者数字0-9或者下划线
//+
bool result=regex_match(username,object);
return result;
}
int main()
{
setwindowstyle();
/**********************/
//用户名和密码
char username[20]="";
char password[10]="";
cout <<"\t用户名:";
cin >> username;
cout <<"\t密 码:";
/**********************/
//密码不可见
//_getch()不可见输入头文件为#include<conio.h>
char key;
int i=0;
while((key=_getch())!='\r')
{
if(i<9)
{
password[i++]=key;
putchar('*');
}
else
{
cout<<"密码过长"<<endl;
system("pause");
return 0;
}
}
//字符串结束标志;\0
password[i]='\0';
cout<<endl;
//cin>>password;
if(checkemail(username))
{
cout<<"\t"<<username<<"是邮箱"<<endl;
if(!strcmp(username,"3439640879@qq.com")&&!strcmp(password,"123456"))
{
proc();
printf("登陆成功!!!!!");
system("pause");
return 0;
//弹出进度条
//播放音乐
cout<<"欢迎主人回家!!!"<<endl;
mciSendString("opean 1.mp3 alias music",0,0,0);
mciSendString("piay music repeat",0,0,0);
}
else
{
cout<<"用户名或密码错误"<<endl;
}
}
else
{
cout<<"\t"<<username<<"不是邮箱"<<endl;
}
system("pause");
return 0;
}

