求C# 检测密码强度模块或例子 如题 谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ajax官方的! 你可以下来看看源码 http://www.asp.net/AJAX/AjaxControlToolkit/Samples/PasswordStrength/PasswordStrength.aspx ajax的话 好像自己本身有函数,在c#的WIN窗体里面貌似没有相应的函数可以使用 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;}参考 GridView头合并的问题 关于GridView分页,请大牛进来 关于SQL SERVER高并发访问的解决办法 解决VS2005中文输入法半角/全角的补丁出来没有? 求教datagridview表头合并 ahchor功能引起的问题? contextmenustrip子菜单获取父级的sourcecontrol SQL 和 MYSQL 的不同? win form listbox问题 如何在C#中实现全局变量,多数据库连接的实现阶段? 导出的EXCEL表的单元格中,如何保留原gridtable背景色,绑定的字体大小和颜色?? 新手问个看起来没有错误的问题.急死了
你可以下来看看源码
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/PasswordStrength/PasswordStrength.aspx
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;
}
参考