SmartUpload使用和简介
来源:互联网 发布:mac os x 10.11.1镜像 编辑:程序博客网 时间:2024/06/06 06:50
SmartUpload使用和简介
用以下代码生成文件名即可
1 package info.haowei.util; 2 3 import java.text.SimpleDateFormat; 4 import java.util.Date; 5 import java.util.Random; 6 7 public class IPTimeStamp { 8 9 10 private SimpleDateFormat sdf = null;11 private String ip = null;12 13 14 public IPTimeStamp(String ip) {15 super();16 17 this.ip = ip;18 }19 20 21 public IPTimeStamp() {22 super();23 }24 25 26 public String getIPTimeRand(){27 StringBuffer buf = new StringBuffer();28 if(this.ip != null){29 String s[] = this.ip.split("\\.");//根据ip以点分割将IP中的数字提取30 for(int i = 0 ; i < s.length; i++){31 buf.append(this.addZero(s[i], 3));//不够三位数的补零32 }33 }34 buf.append(this.getTimeStamp());35 Random r = new Random();//再在结尾加上三个随机数36 for(int i = 0 ; i < 3 ; i++ ){37 buf.append(r.nextInt(10));38 }39 return buf.toString();40 }41 42 private String addZero(String str, int len){43 44 StringBuffer s = new StringBuffer();45 s.append(str);46 while(s.length()<len){47 s.insert(0, 0);48 }49 50 return s.toString();51 }52 53 54 private String getTimeStamp(){//获取时间戳55 this.sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");56 return this.sdf.format(new Date());57 }58 59 public String getDate(){60 this.sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");61 return this.sdf.format(new Date());62 }63 }
0 0
- SmartUpload使用和简介
- javaweb使用smartupload下载文件,和在线打开文件
- jsp上传组件SmartUpload简介
- smartupload jsp 使用
- 使用SmartUpload上传文件
- 使用SmartUpload上传文件
- 使用smartUpload上传附件
- smartUpload简单使用
- smartUpload控件使用
- 使用smartUpload上传附件
- 使用SmartUpload上传图片
- SmartUpload上传下载使用
- SmartUpload的使用
- 使用smartupload上传文件
- 使用smartupload上传图片
- Smartupload和commons-fileupload
- SmartUpload
- smartupload
- Quartz任务调度快速入门
- http://focus.it168.com/200812/testframe/ 软件测试框架技术专题
- 比大小
- 关于工程文件中代码不能修改的解决方法
- 单向链表原理
- SmartUpload使用和简介
- lucene5.2.1 检索文件夹文件Demo
- hdu5305(2015多校2)--Friends(状压,深搜)
- MATLAB小知识
- iOS 解决NSString转换为NSURL时包含中文字符
- 程序员面试宝典一周目第四天
- 3com 4210交换机
- 南阳理工 927 The partial sum problem
- oc中framework的链接问题