Java唯一码生成

2015-11-14 0 183
Java唯一码生成

private static String beforeBh;
private static String beforeNum;

public static String codeGenerate() {
  Date now = new Date();
  String behind = now.getTime()+"";
  if(beforeBh==null) {
   beforeBh = behind;
  } else if(beforeBh.equals(behind)) {
   behind = behind +beforeNum;
   beforeNum++;
  } else {
   beforeBh = behind;
   beforeNum = 0;
  }
  return behind;

遇见资源网 java Java唯一码生成 http://www.ox520.com/9734.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务