身份验证
using System;class Myclass
{
static void Main()
{
string name="lengmianren";
int password=3123486;
int i=4;
Found :
Console.WriteLine("Please input your name:");
string Name=Console.ReadLine();
Console.WriteLine("Please input your password:");
int Password=int.Parse(Console.ReadLine());
if(Name==name&Password==password)
{
Console.WriteLine("Welcome to bingfengguzhu's index.");
}
else
{
i--;
if(i>=1)
{
Console.WriteLine("Sorry,your input is wrong,please input again,but you have only "+i+" chance.");
goto Found;
}
else
{
Console.WriteLine("想进来。^-^");
}
}
System.Threading.Thread.Sleep(3000);
}
}