Ver código fonte

常用公共类 添加年月日字符串

新疆警官学校中职
ndbs 2 anos atrás
pai
commit
4d2fd40622
1 arquivos alterados com 10 adições e 0 exclusões
  1. +10
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Common/CommonHelper.cs

+ 10
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Common/CommonHelper.cs Ver arquivo

@@ -71,6 +71,16 @@ namespace Learun.Util
string code = DateTime.Now.ToString("yyyyMMddHHmmss") + strRandom;//形如
return code;
}
/// <summary>
/// 自动生成编号 年月日 20221207
/// </summary>
/// <returns></returns>
public static string StringTime()
{
Random random = new Random();
string code = DateTime.Now.ToString("yyyyMMdd");
return code;
}
#endregion

#region 生成0-9随机数


Carregando…
Cancelar
Salvar