| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 454 人关注过本帖
标题:不知错哪
取消只看楼主 加入收藏
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
快速回复:不知错哪
数据加载中...
 
   



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

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