JavaѹËõÓë½âѹrarÎļþ
package com.sunz.fileUpload;
public class RarToFile {
//cmd ѹËõÓë½âѹËõÃüÁî
private static String rarCmd = "C:\\Program Files\\WinRAR\\Rar.exe a ";
private static String unrarCmd = "C:\\Program Files\\WinRAR\\UnRar x ";
/**
* ½«1¸öÎļþѹËõ³ÉRAR¸ñʽ rarName ѹËõºóµÄѹËõÎļþÃû(²»°üº¬ºó׺) fileName ÐèҪѹËõµÄÎļþÃû(±ØÐë°üº¬Â·¾¶) destDir
* ѹËõºóµÄѹËõÎļþ´æ·Å·¾¶
*/
public static void RARFile(String rarName, String fileName, String destDir) {
rarCmd += destDir + rarName + ".rar " + fileName;
try {
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(rarCmd);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
/**
* ½«1¸öRARÎļþ½âѹ rarFileName ÐèÒª½âѹµÄRARÎļþ(±ØÐë°üº¬Â·¾¶ÐÅÏ¢ÒÔ¼°ºó׺) destDir ½âѹºóµÄÎļþ·ÅÖÃĿ¼
*/
public static void unRARFile(String rarFileName, String destDir) {
unrarCmd += rarFileName + " " + destDir;
try {
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(unrarCmd);
} catch (Exception e) {
System.out.println(e.getMessage());
}
 
Ïà¹ØÎĵµ£º
JAVAµÄÈÝÆ÷---List,Map,Set
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector
©¦¡¡©¸Stack
©¸Set
Map
©ÀHashtable
©ÀHashMap
©¸WeakHashMap
Collection½Ó¿Ú
¡¡¡¡CollectionÊÇ×î»ù±¾µÄ¼¯ºÏ½Ó¿Ú£¬Ò»¸öCollection´ú±íÒ»×éObject£¬¼´CollectionµÄÔªËØ£¨Elements£©¡£Ò»Ð© CollectionÔÊÐíÏà ......
ÊØ»¤Ị̈߳¨Daemon£©
JavaÓÐÁ½ÖÖThread£º“ÊØ»¤Ïß³ÌDaemon”Óë“Óû§Ïß³ÌUser”¡£
ÎÒÃÇ֮ǰ¿´µ½µÄÀý×Ó¶¼ÊÇÓû§£¬ÊØ»¤Ïß³ÌÊÇÒ»ÖÖ“ÔÚºǫ́ÌṩͨÓÃÐÔÖ§³Ö”µÄỊ̈߳¬Ëü²¢²»ÊôÓÚ³ÌÐò±¾Ìå¡£
´Ó×ÖÃæÉÏÎÒÃǺÜÈÝÒ×½«ÊØ»¤Ïß³ÌÀí½â³ÉÊÇÓÉÐéÄâ»ú£¨virtual machine£©ÔÚÄÚ²¿´´½¨µÄ£¬¶øÓû§Ïß³ÌÔòÊÇ×Ô ......
Java²»ÊÇÍêÃÀµÄ£¬JavaµÄ²»×ã³ýÁËÌåÏÖÔÚÔËÐÐËÙ¶ÈÉÏÒª±È´«Í³µÄC++ÂýÐí¶àÖ®Í⣬JavaÎÞ·¨Ö±½Ó·ÃÎʵ½²Ù×÷ϵͳµ×²ã£¨ÈçϵͳӲ¼þµÈ)£¬Îª´ËJavaʹÓÃnative·½·¨À´À©Õ¹Java³ÌÐòµÄ¹¦ÄÜ¡£
¿ÉÒÔ½«native·½·¨±È×÷Java³ÌÐòͬ£Ã³ÌÐòµÄ½Ó¿Ú£¬ÆäʵÏÖ²½Ö裺
£±¡¢ÔÚJavaÖÐÉùÃ÷native()·½·¨£¬È»ºó±àÒ룻
£²¡¢ÓÃjavah²úÉúÒ»¸ö.hÎļþ£»
£³¡¢Ð´Ò ......
1.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:xyz est.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸öURL¾ø¶Ô·¾¶¡£
Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚ
ServletÖУ¬ ......
ÄÚ²¿ÀàµÄʹÓõÄÓÅȱµã£º
Óŵ㣺¼õÉÙÁËÔÚÀàÎļþ±àÒëºóµÄ²úÉúµÄ×Ö½ÚÂëÎļþµÄ´óС
ȱµã£ºÊ¹³ÌÐò½á¹¹²»ÇåÎú
ʹÓÃÄÚ²¿ÀàµÄ×¢ÒâÊÂÏ
ÄÚ²¿ÀàµÄʹÓÃÒ»°ã¶¼ÓëËùÔÚµÄÍⲿÀàÓÐÒ»¶¨µÄ¹ØÁª£¬ËüÊÇÔÚÒ»¸öÀàµÄÄÚ²¿Ç¶Ì׶¨ÒåµÄÀ࣬Ëü¿ÉÒÔÊÇÆäËüÀàµÄ³ÉÔ±£¬Ò²¿ÉÒÔÔÚÒ»¸öÓï¾ä¿éµÄÄÚ²¿¶¨Ò壬»¹¿ÉÒÔÔÚ±í´ïʽÄÚ²¿ÄäÃû¶¨Òå(ÄäÃûÄÚ²¿Àà)¡£
ÄÚ²¿ ......