标题:不知错哪
取消只看楼主
wanxingdai
Rank: 1
等 级:新手上路
帖 子:31
专家分:6
注 册:2010-9-21
结帖率:55.56%
已结贴  问题点数:10 回复次数:1 
不知错哪
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 密码登入
{
    class Program
    {
        static void Main(string[] args)
        {
            string id;
            string useid;
           //string usepw="";
            int count = 0;
            Console.Write("请注册帐号:\n");
            id = Console.ReadLine();
            Console.Write("请设定密码:\n");
            string pw =Console.ReadLine();
            Console.Clear();
            while (count<=3)
            {
                while (true)
                {
                    
                    Console.Write("请输入你的帐号:\n");
                    useid = Console.ReadLine();
                    Console.Write("请输入密码:\n");
                    ConsoleKeyInfo usepw = Console.ReadKey(true);
                    if (usepw.Key== ConsoleKey.Enter) break;
                    Console.Write("*");
                    usepw = usepw + pw.KeyChar.ToString();
                    if (useid == id && usepw.KeyChar.ToString() == pw)
                    {
                        Console.Write("登入成功!!!");
                    }
                    else
                    {
                        Console.Write("请重新登入:\n");
                        count++;
                        if (count%3==0)
                            break;
                    }
                    Console.Clear();
                    Console.Write("登入失败!!!");
                    Console.ReadKey();
                }
            }
        }
    }
}
搜索更多相关主题的帖子: 注册帐号 count 密码 
2011-03-21 22:42
wanxingdai
Rank: 1
等 级:新手上路
帖 子:31
专家分:6
注 册:2010-9-21
得分:0 
要怎么改啊
2011-03-22 13:11



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-334354-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.941881 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved