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 =
Ïà¹ØÎĵµ£º
´«ÖDz¥¿ÍjavaÅàѵ2010Äê4ÔÂ10ÈÕajaxÔöÇ¿×ܽá1
½ñÌìµÄ¿Î£¬ÎÒÖ»ÄÜÓþªÑÈÀ´ÊµÏÖ£¬ÒòΪËäÈ»ÒÔǰÎÒ×Ô¼º×ö¿ª·¢µÄʱºòÒ²»á¾³£Óõ½javascriptÀ´×öһЩ¶«Î÷£¬²¢ÇÒÒ²ÄÜʵÏÖËùÒªÐèÒªµÄ¹¦ÄÜ×ö£¬ÎÒûÓÐÏëµ½µÄÊÇ£¬ÆäÖÐÓõ½µÄһЩ¹¦ÄܾÓÈ»¿ÉÒÔÓúܼòµ¥µÄÓïÑÔ¾ÍÄÜʵÏÖ£¬²»À¢ÊǶàÄê×ܽáÏÂÀ´µÄ¾Ñ飡ÎÒÔÚÏëÈç¹ûÎÒÈÔ¾ÉÔÚÔÏȵĸÚλÉϼÌÐø×ö ......
¹ØÓÚJavaŵÂüµ×µÄÒ»µãСÀúÊ·
×î½üºÜ¶àÈËÎÊJavaŵÂüµ×ÊÇʲôÒâ˼£¬×÷ΪJavaŵÂüµ×µÄÒ»ÃûÀÏͬ־£¬ÎÒ¼òµ¥µÄ½éÉÜÏÂJavaŵÂüµ×¡£
JavaŵÂüµ×³ÉÁ¢ÓÚ2008Äê7ÔÂ29ÈÕ£¬ÔÚÒ»¸öÈȺ¹³¯ÌìµÄÈÕ×ÓÀ¼¸¸öÂú»³Ï£ÍûµÄÓÐÖ¾ÇàÄê£¬×øÔÚÏæ½ºÓ°ø£¬Ì¸×Å×Ô¼ºÀíÏ룬ÆäÖÐÒ»ÈË˵£¬¼ÙÈçÎÒÃÇÓÐ×Ô¼ºµÄÍŶӸÃÓжàºÃ£¬ÓÚÊ ......
import java.io.*;
import java.math.*;
import java.util.*;
public class Main
{
public static void main(String[] args)
{
Scanner cin=new Scanner(System.in);
BigDecimal a; ......
Ïà¶Ô·¾¶µÄ»ñµÃ
¡¡¡¡ ˵Ã÷:Ïà¶Ô·¾¶(¼´²»Ð´Ã÷ʱºòµ½µ×Ïà¶ÔË)¾ù¿Éͨ¹ýÒÔÏ·½Ê½»ñµÃ£¨²»ÂÛÊÇÒ»°ãµÄjavaÏîÄ¿»¹ÊÇwebÏîÄ¿£©
¡¡¡¡ String
relativelyPath=System.getProperty("user.dir");
¡¡¡¡
ÉÏÊöÏà¶Ô·¾¶ÖУ¬javaÏîÄ¿ÖеÄÎļþÊÇÏà¶ÔÓÚÏîÄ¿µÄ¸ùĿ¼
¡¡¡¡ webÏîÄ¿ÖеÄÎļþ·¾¶ÊÓ²»Í¬µÄweb·þÎñÆ÷²»Í¬¶ø²»Í¬£¨tomcatÊÇ ......