zoukankan      html  css  js  c++  java
  • 密码

    /*
     * 由SharpDevelop创建。
     * 用户: Administrator
     * 日期: 2018/10/20
     * 时间: 15:53
     * 
     * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
     */
    using System;
    
    namespace C密码
    {
        class Program
        {
            public static void Main(string[] args)
            {
                string str=Console.ReadLine();
                if (str.Length>=8&&str.Length <=16) {
                     bool isHaveUpper=false;//大写
                    bool isHaveLower=false;//小写
                    bool isHaveNamber=false;//数字
                    bool isHaveSpecial=false;//符号
                    for (int i = 0; i < str.Length; i++) {
                        if(str[i]>='A'&&str[i]<='Z'){
                            isHaveUpper=true ;
                        }if(str[i]>='a'&&str[i]<='z'){
                            isHaveLower=true ;
                        }if(str[i]>='0'&&str[i]<='9'){
                            isHaveNamber=true ;
                        }if(str[i]=='~'||str[i]=='!'||str[i]=='@'||str[i]=='#'||str[i]=='$'||str[i]=='%'||str[i]=='^'){
                            isHaveSpecial=true ;
                        }
                    }
                    int count=0;
                    if(isHaveUpper )count ++;
                    if(isHaveLower )count ++;
                    if(isHaveNamber)count ++;
                    if(isHaveSpecial )count ++;
                    if(count >=3){
                        Console.WriteLine("这个密码安全 ");
                    }    else
            {
                Console.WriteLine("这个密码不安全");
                }
                }
                else
            {
                Console.WriteLine("这个密码不安全,长度不符合规则 ");
                }
                
                // TODO: Implement Functionality Here
                
                Console.Write("Press any key to continue . . . ");
                Console.ReadKey(true);
            }
        }
    }

  • 相关阅读:
    Centos Another app is currently holding the yum lock
    Centos 重置密码
    Effective c#学习笔记(1)
    浅谈计算机编码
    mongodb java spring data
    VS2013 好用的插件
    xml存储bug
    VS 2008 生成操作中各个选项的差别
    程序权限控制
    给钛度产品的一些建议(Note)
  • 原文地址:https://www.cnblogs.com/llhhcc/p/9822164.html
Copyright © 2011-2022 走看看