

Java技术
2005: 03 04 05 06 07 08
09 10 11 12
2006: 01 02
Asp.net
2005: 07 08 09 10 11 12
2006: 01 02

今天在外面看书 看到一个写登陆的程序 可是没有限制登陆的次数
想了一下 做了这个程序 简单的来表示一下如何限制 登陆次数
using System;
namespace Ginger547
{
class Class1
{
public static void Main(string[] args)
{
int i = 3;
string strInput = null ;
for (i = 1 ; i<= 3 ; i++)
{
Console.WriteLine ("输入密码");
strInput = Console.ReadLine();
if (strInput =="Ginger547")
break;
else
Console.WriteLine("密码错误,无法进入");
Console.WriteLine();
}
if (strInput == "Ginger547")
Console.WriteLine("Login 成功");
else
Console.WriteLine("非法进入.......");
Console.ReadLine();
}
}
}