#作业目标:
##编码:
//输出菜单
Console.WriteLine("*****欢迎进入奖客富翁系统*****");
Console.WriteLine(@" 1.注册
2.登录
3抽奖");
Console.WriteLine("*****************************");
Console.Write("请选择:");
//选择菜单编号
string str_num = Console.ReadLine();
try
{
int num = Convert.ToInt32(str_num);
switch (num)
{
case 1:
Console.WriteLine("富豪系统>注册");
break;
case 2:
Console.WriteLine("富豪系统>登录");
break;
case 3:
Console.WriteLine("富豪系统>抽奖");
break;
default:
Console.WriteLine("您输入有误!");
break;
}
//注册界面
Console.WriteLine("请填写个人注册信息");
Console.Write("用户名:");
string nam = Console.ReadLine();
Console.Write("密码:");
string key = Console.ReadLine();
//随机函数
int max = 99999;
int min = 1000;
Random rd = new Random();
rd.Next(min, max);
int b = rd.Next(min, max);
Console.WriteLine("");
Console.WriteLine("注册成功请记住你的会员卡号!");
Console.WriteLine("用户名\t密码\t会员卡号");
Console.WriteLine("{0}\t{1}\t{2}",nam,key,b);
//询问是否继续
Console.Write("继续吗? (Y/N):");
string a = Console.ReadLine();
//判断
if (a == "N")
{
Console.WriteLine("系统退出!谢谢使用!");
}
}
catch { Console.WriteLine("您输入有误!"); }
Console.ReadKey();