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

来源:互联网 发布:python excel 修改 编辑:程序博客网 时间:2024/06/04 19:51
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

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

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

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

 

}

}

}

 

<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击