初始刷

This commit is contained in:
2024-11-28 13:36:05 +08:00
parent b9b7c9090e
commit 88ebd4c300
753 changed files with 62888 additions and 64 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.Text;
namespace ZR.Infrastructure.Helper
{
public class RandomHelper
{
/// <summary>
/// 生成n为验证码
/// </summary>
/// <param name="Length"></param>
/// <returns></returns>
public static string GenerateNum(int Length)
{
char[] constant = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
StringBuilder newRandom = new(constant.Length);
Random rd = new();
for (int i = 0; i < Length; i++)
{
newRandom.Append(constant[rd.Next(constant.Length - 1)]);
}
return newRandom.ToString();
}
}
}