- 浏览: 71519 次
- 性别:
- 来自: 石家庄
-
最新评论
-
杨春超:
加油老婆,咱们一起努力。
现在的生活 -
jiao5674836:
头像比帖子耐看,不知道是不是本人。
多线程
文章列表
// 将string类型的时间转换成SQL date 型
public Date dateChange(String date1)
{
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
java.util.Date cDate;
Date dd=null;
try {
cDate = sdf.parse(date1);
dd =new Date(cDate.getTime());
} catch (ParseException e) {
/ ...
/**
* 随机生成四位验证码,可以给代码写在servlet 里,将验证码保存在servlet类中
* request.getSession().setAttribute("piccode", sb.toString());
* request.getSession().removeAttribute(sb.toString());
* ImageIO.write(img, "JPG", response.getOutputStream());
* 用户输入的验证码 可以和session的属 ...
public String getFileTime(String filename) {
String filetime = "";
try {
Process p = Runtime.getRuntime().exec(
"cmd /C dir d:\\upload\\" + filename + " /tc");
InputStream is = p.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamRe ...
public String FormateSize(long size) {
double baseKB = 1024, baseMB = 1024 * 1024, baseGB = 1024 * 1024 * 1024;
String strSize = "";
if (size < baseKB) {
strSize = Long.toString(size) + "B";
} else if (size > baseKB && size < baseMB) {
strSize = Doub ...
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ").format(new Date());