当前位置 : 主页 > 编程语言 > java >

生成文件名字

来源:互联网 收集:自由互联 发布时间:2021-06-28
生成文件名字 private String file()throws Exception { String str[] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" }; Random tmp = new Random(); String fileName = System.currentTimeMillis() + str[tmp.nextInt(10)] + "." + "xlsx"; r
生成文件名字
private String file()throws Exception {
        String str[] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
        Random tmp = new Random();
        String fileName = System.currentTimeMillis() + str[tmp.nextInt(10)] + "." + "xlsx";
        return  "C:\\Users\\wo\\Desktop\\"+fileName;
    }
网友评论