wikiki

 

/** 
     * 生成随机文件名:当前年月日时分秒+五位随机数 
     *  
     * @return 
     */  
    public static String getRandomFileName() {  
  
        SimpleDateFormat simpleDateFormat;  
  
        simpleDateFormat = new SimpleDateFormat("yyyyMMdd");  
  
        Date date = new Date();  
  
        String str = simpleDateFormat.format(date);  
  
        Random random = new Random();  
  
        int rannum = (int) (random.nextDouble() * (99999 - 10000 + 1)) + 10000;// 获取5位随机数  
  
        return rannum + str;// 当前时间  
    }

  

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2022-02-04
  • 2021-12-12
  • 2022-01-23
猜你喜欢
  • 2021-12-06
  • 2022-12-23
  • 2021-12-06
  • 2021-07-09
  • 2021-12-06
相关资源
相似解决方案