优化常量设置&新增导入用户方法

This commit is contained in:
不做码农
2022-10-17 19:39:56 +08:00
parent 6c3efee19a
commit 65da2e3f2a
4 changed files with 59 additions and 2 deletions

View File

@@ -80,6 +80,19 @@ namespace ZR.Common
return false;
}
}
public static bool CheckUserName(string str)
{
try
{
string rg = @"^[a-z][a-z0-9-_]*$";
return Regex.IsMatch(str, rg);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return false;
}
}
/// <summary>
/// 计算密码强度