WhatsApp怎么恢复聊天数据
zfg201314 可以通过File流的lastModified方法获取到修改whatsapp网页版消息发送时间的。举例:public static void getModifiedTime(){
File f = new File("C:\\test.txt");
Calendar cal = Calendar.getInstance();
long whatsapp官方网下载2020time = f.lastModified();
cal.setTimeInMillis(time);
System.out.println("修改时间: " + cal.getTime().toLocaleString());
}
结果:修改时间WhatsApp网页版营销系统:2015-06-29 10:32:38 ab1151231642 Calendar cal= new GregorianCalendar.setTimeInMillis( new File ("c:\1.txt").lastModified());
System.ou华为市场怎样下载whatsappt.print(cal.toString()); yangfei524 能想到的是:可以用Java 高命令行的方式来做。但是不太好判断系统中不存在能打开这种文件的程序的情况,只能想其他办法。比如在进程中来判断文件有没有被打开等。示例(注意命令前面的 cmd /C ):package com;public class Test3 { /** * @param args */ public st手机whatsapp下载atic void main(String[] args) { String cmd = "cmd /C d:\\files\\text.txt"; Process p; try { p = Runtime.getRuntime().exec(cmd); } catch (Exception e) { e.printStackTrace(); } }} wwhatsapp怎么打开y037 package com.xian.home2;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
impowhatsapp网页版头像可以下载吗rt java.io.InputStream;
import java.io.InputStreamReader;whatsapp网页版怎样发大视频
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
public class FileOperate {
/**
* @param args
*/
public static void main(String[] args) {
// FileOperate fo = new FileOperate();
// Strinwhatsapp网页版如何扫码登录g filepath = "G:\\02";
// fo.getFileList(filepath);
getCreateTime();
}
public List<File> getFileList(String filewhatsapp怎么改自己昵称path) {
try {
File file = new File(filepath);
if (file.isDirectory()) {
String[] filelist = file.list();
for (int i = 0; i < filelist.lengtwhatsapp国际版下载h; i++) {
File Ifile = new File(filepath + "\\" + filelist[i]);
FileInputStream fis = new FileInputStream(Ifile);
long modifiedTime = Ifile.lastModified();
Date date=new Date(modifiedTime);
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM");
String dd=sdf.format(date);
System.out.println("File name:" + Ifiwhatsapp网页版登陆恢复le.getNwhatsapp官方网下载最新ame()
+ " \tFile size: &quowhatsapp图片无法下载t;
+ (double) ((double) fis.available() / 1024 / 1024)
+ "M"+ " \tFile create Time: "+dd);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* 读取文件创建时间
*/
public static void getCreateTime(){
String filePath = "G:\\02\\123.txt";
String strTime = null;
try {
Process p = Runtime.getRuntime().exec("cmd /C dir "
+ filePath
+ "/tc" );
InputStream is = p.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line;
while((line = br.readLine()) !whatsapp无法接收验证码= null){
if(line.endsWith(".txtwhatsapp批量群发")){
strTime = line.substring(0,17);
break;
}
}
}whatsapp平板版 catch (IOException e) {
e.printStackTrace();
}
System.out.println("创建时间" + strTime);
//输出:创建时间2009-08-17 10:21
}
/**
* 读取文件修改时间的方法1
*/
@SuppressWarnings("deprecation")
public static void getModifiedTime_1(){
File f = new File("C:\\test.txt");
Calendar cal = Calendar.getInstawhatsapp网页版网页登陆nce();
long time = f.lastModified();
cal.setTimeInMillis(time);
//此处toLocalString()方法是不推华为下载whatsapp方法荐的,但是仍可输出
System.out.println("修改时间[1] " + cal.getTime().toLocaleString());
//输出:修改时间[1]2009-8-17 10:32:38
}
/**
* 读取修改时间的方法2
*/
public static void getModifiedTime_2(){
File f = new File("C:\\test.txt");
Calendar cal = Cwhatsapp改昵称alendar.getInstance();
long time = f.lastModified();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
cal.setTimeInMillis(time);
System.out.println("修改时间[2] " + formatter.format(cal.getTime()));
//输出:修改时间[2]2009-08-17 10:32:38
}
}
WhatsApp网页版请注明:WhatsApp网页版 » whatsapp怎么恢复聊天数据 java编写程序获取指定文件的最终修改时间