您可以在这里快速查找:


 
您的位置: 编程学习 > asp.net教程 > 200509
文章分类

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

VB编程
2006: 02

Asp编程
2005: 11 12
2006: 01 02

C++/VC
2005: 10 11 12
2006: 01 02

Delphi
2005: 12
2006: 01 02

其它

 本文章适合所有读者

限制输入次数的系统登陆的实现

Ginger547

今天在外面看书 看到一个写登陆的程序 可是没有限制登陆的次数

想了一下 做了这个程序 简单的来表示一下如何限制 登陆次数

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();

 

}

}

}