繁体中文
设为首页
加入收藏
当前位置:.Net技术首页 >> Asp.Net开发 >> 限制输入次数的系统登陆的实现

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

2007-08-15 08:00:00  作者:  来源:互联网  浏览次数:0  文字大小:【】【】【
简介:今天在外面看书 看到一个写登陆的程序 可是没有限制登陆的次数 想了一下 做了这个程序 简单的来表示一下如何限制 登陆次数 using System; namespace Ginger547 { class Class1 { public static void Main(string...

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

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

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

}

}

}

责任编辑:admin
相关文章