JavaÎļþ²Ù×÷´óÈ«£¨Ò»£©
1.´´½¨Îļþ¼Ð
//import java.io.*;
File myFolderPath = new File(%%1);
try {
if (!myFolderPath.exists()) {
myFolderPath.mkdir();
}
}
catch (Exception e) {
System.out.println("н¨Ä¿Â¼²Ù×÷³ö´í");
e.printStackTrace();
}
2.´´½¨Îļþ
//import java.io.*;
File myFilePath = new File(%%1);
try {
if (!myFilePath.exists()) {
myFilePath.createNewFile();
}
FileWriter resultFile = new FileWriter(myFilePath);
PrintWriter myFile = new PrintWriter(resultFile);
myFile.println(%%2);
resultFile.close();
}
catch (Exception e) {
System.out.println("н¨Îļþ²Ù×÷³ö´í");
e.printStackTrace();
}
3.ɾ³ýÎļþ
//import java.io.*;
File myDelFile = new File(%%1);
try {
myDelFile.delete();
}
catch (Exception e) {
System.out.println("ɾ³ýÎļþ²Ù×÷³ö´í");
e.printStackTrace();
}
4.ɾ³ýÎļþ¼Ð
//import java.io.*;
File delFolderPath = new File(%%1);
try {
delFolderPath.delete(); //ɾ³ý¿ÕÎļþ¼Ð
}
catch (Exception e) {
System.out.println("ɾ³ýÎļþ¼Ð²Ù×÷³ö´í");
e.printStackTrace();
}
5.ɾ³ýÒ»¸öÎļþϼÐËùÓеÄÎļþ¼Ð
//import java.io.*;
File delfile=new File(%%1);
File[] files=delfile.listFiles();
for(int i=0;i<files.length;i++){
if(files[i].isDirectory()){
files[i].delete();
}
}
6.Çå¿ÕÎļþ¼Ð
//import java.io.*;
File delfilefolder=new File(%%1);
try {
if (!delfilefolder.exists()) {
delfilefolder.delete();
}
delfilefolder.mkdir();
}
catch (Exception e) {
System.out.println("Çå¿ÕĿ¼²Ù×÷³ö´í");
e.printStackTrace();
}
7.¶ÁÈ¡Îļþ
//import java.io.*;
// ÖðÐжÁÈ¡Êý¾Ý
FileReader fr =
Ïà¹ØÎĵµ£º
1£®Ç³¸´ÖÆÓëÉî¸´ÖÆ¸ÅÄî
¢Ådz¸´ÖÆ£¨Ç³¿Ë¡£©
±»¸´ÖƶÔÏóµÄËùÓбäÁ¿¶¼º¬ÓÐÓëÔÀ´µÄ¶ÔÏóÏàͬµÄÖµ£¬¶øËùÓÐµÄ¶ÔÆäËû¶ÔÏóµÄÒýÓÃÈÔȻָÏòÔÀ´µÄ¶ÔÏó¡£»»ÑÔÖ®£¬Ç³¸´Öƽö½ö¸´ÖÆËù¿¼ÂǵĶÔÏ󣬶ø²»¸´ÖÆËüËùÒýÓõĶÔÏó¡£
¢ÆÉî¸´ÖÆ£¨Éî¿Ë¡£©
±»¸´ÖƶÔÏóµÄËùÓбäÁ¿¶¼º¬ÓÐÓëÔÀ´µÄ¶ÔÏóÏàͬµÄÖµ£¬³ýÈ¥ÄÇЩÒýÓÃÆäËû¶ÔÏóµÄ±äÁ¿¡ ......
JAVA¶¨Ê±Ö´ÐÐÈÎÎñµÄÈýÖÖ·½·¨
1) java.util.Timer
Õâ¸ö·½·¨Ó¦¸ÃÊÇ×î³£Óõ쬲»¹ýÕâ¸ö·½·¨ÐèÒªÊÖ¹¤Æô¶¯ÄãµÄÈÎÎñ£º
Timer timer=new Timer();
timer.schedule(new ListByDayTimerTask(),10000,86400000);
ÕâÀïµÄListByDayTimerTaskÀà±ØÐëextends TimerTaskÀïÃæµÄrun()·½·¨¡£
2) ServletContextListener
Õâ¸ö·½·¨ ......
Ctrl+1 ¿ìËÙÐÞ¸´(×î¾µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌØ±ðʵÓÃ,¿ÉÒÔʡȥÏȼôÇÐ,ÔÙÕ³ÌùÁË)
Alt+↑ µ±Ç°ÐкÍÉÏÃæÒ»Ðн»»¥Î»ÖÃ(ͬÉÏ)
Alt+← ǰһ¸ö±à¼µ ......