javaÎļþ²Ù×÷
1.´´½¨Îļþ¼Ð
File myFolderPath = new File(%%1);
try {
if (!myFolderPath.exists()) {
myFolderPath.mkdir();
}
}
catch (Exception e) {
System.out.println("н¨Ä¿Â¼²Ù×÷³ö´í");
e.printStackTrace();
}
2.´´½¨Îļþ
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.ɾ³ýÎļþ
File myDelFile = new File(%%1);
try {
myDelFile.delete();
}
catch (Exception e) {
System.out.println("ɾ³ýÎļþ²Ù×÷³ö´í");
e.printStackTrace();
}
4.ɾ³ýÎļþ¼Ð
File delFolderPath = new File(%%1);
try {
delFolderPath.delete(); //ɾ³ý¿ÕÎļþ¼Ð
}
catch (Exception e) {
System.out.println("ɾ³ýÎļþ¼Ð²Ù×÷³ö´í");
e.printStackTrace();
}
5.ɾ³ýÒ»¸öÎļþϼÐËùÓеÄÎļþ¼Ð
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.Çå¿ÕÎļþ¼Ð
File delfilefolder=new File(%%1);
try {
if (!delfilefolder.exists()) {
delfilefolder.delete();
}
delfilefolder.mkdir();
}
catch (Exception e) {
System.out.println("Çå¿ÕĿ¼²Ù×÷³ö´í");
e.printStackTrace();
}
7.¶ÁÈ¡Îļþ
// ÖðÐжÁÈ¡Êý¾Ý
FileReader fr = new FileReader(%%
Ïà¹ØÎĵµ£º
Èí»Ø³µ£¨Soft Return£©£ºÈí»Ø³µÊÇÔÚ×Ö´¦Àí³ÌÐòÖÐ×÷Ϊ×Ô¶¯ÒÆÐй¦ÄܵÄÒ»²¿·Ö×Ô¶¯²åÈëµÄ£¬Ò²½Ð»»Ðзû£¬ÔÚwordÖп´²»¼û¡£Èç¹ûÎı¾
Ò»Ðеij¤¶È³¬¹ýÎĵµËù¶¨ÒåµÄÓұ߾àʱ£¬¼´µ±Ç°ÐÐûÓÐ×ã¹»µÄ¿Õ¼ä·ÅÖÃÏÂÒ»¸ö×Ö·ûʱ£¬ÎÄ×Ö´¦ÀíÈí¼þ½«ÔÚÕâÒ»ÐÐÎı¾µÄĩβ×Ô¶¯²åÈëÒ»
¸öÈí»Ø³µ·û£¬Îı¾ÁíÆðÒ»ÐС£Õâ¸öÈí»Ø³µ·ûÊÇÓɱ༳ÌÐò×Ô¶¯² ......
來Ô´£ºhttp://www.blogjava.net/oxidy/articles/213105.html
1.°üÃüÃû:È«²¿×ÖĸСд:cn.package.bean
2.ÀàÃüÃû:µ¥´ÊµÄÊ××Öĸ´óд:SimpleBean
3.ÊôÐÔÃû³Æ:µÚÒ»¸öµ¥´ÊµÄÊ××ÖĸСд,Ö®ºóÿ¸öµ¥´ÊµÄÊ××Öĸ´óдstudentName
4.·½·¨ÃüÃû:ÓëÊôÐÔÃüÃûÏàͬ:public
void sayHello()
5.³£Á¿ÃüÃû:È«²¿µ¥´Ê´óд:final S ......
±ØÐëÓÃthis¹Ø¼ü×ÖµÄÈýÖÖÇé¿ö:
1.ÎÒÃÇÏëͨ¹ý¹¹Ôì·½·¨½«Íⲿ´«ÈëµÄ²ÎÊý¸³Öµ¸ø³ÉÔ±±äÁ¿,¶ø¹¹Ôì·½·¨µÄÐÎʽ²ÎÊýÓëÀà³ÉÔ±µÄ±äÁ¿ÃûÏàͬ,Õâʱ¾ÍÐèÒªthisÕâ¸ö¹Ø¼ü×ÖÀ´Çø±ð¾Ö²¿±äÁ¿ÓëÀà±äÁ¿;
2.¼ÙÉèÓÐÒ»¸öÈÝÆ÷ÀàºÍÒ»¸ö²¿¼þÀà,ÔÚÈÝÆ÷ÀàµÄij¸ö·½·¨ÖÐÒª´´½¨²¿¼þÀàµÄʵÀý¶ÔÏó,¶ø²¿¼þÀàµÄ¹¹Ôì·½·¨Òª½ÓÊÕÒ»¸ö´ú±íÆäËùÔÚÈÝÆ÷µÄ²ÎÊý,ÕâÊ±Ò²Ò ......
1.java¹ýÂËÆ÷¶ÔextÒì²½ÇëÇóÌøת
Óû§·ÃÎʳ¬Ê±
½â¾öÁ½ÖÖÇé¿öϵÄÓû§·ÃÎʳ¬Ê±¡£
a£©ÆÕͨhttpÇëÇóµÄsession³¬Ê±¡£
b£©Òì²½httpÇëÇóµÄsession³¬Ê±£¬Ê¹ÓÃextºó´ó²¿·ÖµÄ½çÃæˢж¼ÊÇÒì²½µÄajaxÇëÇó¡£
²»¹ÜÊÇÄÇÖÖÀàÐ͵ÄhttpÇëÇó×ÜÊÇ¿ÉÒÔÓÉÒ»¸ö¹ýÂËÆ÷À´²¶×½¡£
·ÖÀࣺÆÕͨhttpÇëÇóµÄheader²ÎÊýÖÐûÓÐx-requested-with: ......