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

王朝other·作者佚名  2006-01-09
宽屏版  字体: |||超大  

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

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

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

}

}

}

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有