package com.ycy.test; import java.text.SimpleDateFormat; import java.util.Date; public class ItemsController { public static void main(String[] args) { SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmsss");//设置日期格式 String date = df.forma
String requestData = "something you want to save"; String saveFilePath = "C:\\Users\\xxxx\\Documents\\xxxxx\\"; String dateNow = (new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss")).format(new Date()); java.io.FileWriter fw = new ja
该类利用Preferences保存文本,数字等简单数据,在Windows平台下,它就保存到了系统注册表中,而Linux中它存在于用户目录下的一个隐藏文件中. public class Pref{ private Preferences prefs; public Pref(){ prefs = Preferences.userNodeForPackage(Pref.class); } public void save(S