不知错哪
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 密码登入
{
class Program
{
static void Main(string[] args)
{
string id;
string useid;
//string usepw="";
int count = 0;
Console.Write("请注册帐号:\n");
id = Console.ReadLine();
Console.Write("请设定密码:\n");
string pw =Console.ReadLine();
Console.Clear();
while (count<=3)
{
while (true)
{
Console.Write("请输入你的帐号:\n");
useid = Console.ReadLine();
Console.Write("请输入密码:\n");
ConsoleKeyInfo usepw = Console.ReadKey(true);
if (usepw.Key== ConsoleKey.Enter) break;
Console.Write("*");
usepw = usepw + pw.KeyChar.ToString();
if (useid == id && usepw.KeyChar.ToString() == pw)
{
Console.Write("登入成功!!!");
}
else
{
Console.Write("请重新登入:\n");
count++;
if (count%3==0)
break;
}
Console.Clear();
Console.Write("登入失败!!!");
Console.ReadKey();
}
}
}
}
}