求一个用VC写一个文本框里面的密码,检查验证输入后密码的强度并且显示强中弱,的一个函数..
    谢谢勒

解决方案 »

  1.   

    简单说一下int GetPswStregthLevel(string strPsw)
    {
       int nType = 0;
       int nNum = 0, nChar = 0, nSymbol = 0;
      for (int i =0;i<strPsw.size();i++)
      {
        if (strPsw[i] < '9' && strPsw[i] >'0')
             nNum = 1;
        else
        if (strPsw[i] < 'z' && strPsw[i] > 'A')
             nChar = 1;
        else 
             nSymbol = 1;
      }
       return nNum + nChar + nSymbol;
    }返回1表示弱,2表示中等,3表示强,不知道这样写对不对,还没测试过。
      

  2.   

    找到空间变化就反映的这个函数,然后调用1楼的程序,在修改该你显示强中弱的那个空间的值即可。MFC相当好实现