如题 谢谢

解决方案 »

  1.   

    ajax官方的! 
    你可以下来看看源码 
    http://www.asp.net/AJAX/AjaxControlToolkit/Samples/PasswordStrength/PasswordStrength.aspx
      

  2.   

    ajax的话 好像自己本身有函数,在c#的WIN窗体里面貌似没有相应的函数可以使用
      

  3.   

    var getStrength = function(passwd) {
    intScore = 0;
    if (passwd.match(/[a-z]/)) 
    {
    intScore = (intScore+1)
    } if (passwd.match(/[A-Z]/)) 
    {
    intScore = (intScore+5)

    if (passwd.match(/\d+/)) 
    {
    intScore = (intScore+5)
    } if (passwd.match(/(\d.*\d.*\d)/)) 
    {
    intScore = (intScore+5)

    if (passwd.match(/[!,@#$%^&*?_~]/)) 
    {
    intScore = (intScore+5)
    } if (passwd.match(/([!,@#$%^&*?_~].*[!,@#$%^&*?_~])/)) 
    {
    intScore = (intScore+5)

    if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/)) 
    {
    intScore = (intScore+2)

    if (passwd.match(/\d/) && passwd.match(/\D/)) // [verified] both letters and numbers
    {
    intScore = (intScore+2)

    if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/) && passwd.match(/\d/) && passwd.match(/[!,@#$%^&*?_~]/))
    {
    intScore = (intScore+2)
    }
    return intScore;
    }
    参考