javaÖеõ½µ±Ç°Â·¾¶
¹éÄÉһЩÍøÉÏÈ¡JAVA·¾¶µÄ·½·¨£º
×¢Ã÷£ºÈç¹û´ÓANTÆô¶¯³ÌÐò£¬this.getClass().getResource("")È¡³öÀ´µÄ±È½Ï¹Ö£¬Ö±½ÓÓÃJAVAÃüÁîÐе÷ÊԾͿɳÉ
¹¦¡£
µÃµ½classpathºÍµ±Ç°ÀàµÄ¾ø¶Ô·¾¶µÄһЩ·½·¨
»ñµÃCLASSPATHÖ®Íâ·¾¶µÄ·½·¨£º
URL base = this.getClass£¨£©.getResource£¨""£©£»
//ÏÈ»ñµÃ±¾ÀàµÄËùÔÚλÖã¬Èç/home/popeye/testjava/build/classes/net/ String path = new
File£¨base.getFile£¨£©£¬ "……/……/……/"+name£©.getCanonicalPath£¨£©£»
//¾Í¿ÉÒԵõ½/home/popeye/testjava/name
ÏÂÃæÊÇһЩµÃµ½classpathºÍµ±Ç°ÀàµÄ¾ø¶Ô·¾¶µÄһЩ·½·¨¡£Äã¿ÉÄÜÐèҪʹÓÃÆäÖеÄһЩ·½·¨À´µÃµ½ÄãÐèÒªµÄ×ÊÔ´µÄ¾ø¶Ô·¾¶¡£
1.FileTest.class.getResource£¨""£©
µÃµ½µÄÊǵ±Ç°ÀàFileTest.classÎļþµÄURIĿ¼¡£²»°üÀ¨×Ô¼º£¡
È磺file£º/D£º/java/eclipse32/workspace/jbpmtest3/bin/com/test/
2.FileTest.class.getResource£¨"/"£©
µÃµ½µÄÊǵ±Ç°µÄclasspathµÄ¾ø¶ÔURI·¾¶¡£
È磺file£º/D£º/java/eclipse32/workspace/jbpmtest3/bin/
3.Thread.currentThread£¨£©.getContextClassLoader£¨£©.getResource£¨""£©
µÃµ½µÄÒ²Êǵ±Ç°ClassPathµÄ¾ø¶ÔURI·¾¶¡£
È磺file£º/D£º/java/eclipse32/workspace/jbpmtest3/bin/
4.FileTest.class.getClassLoader£¨£©.getResource£¨""£©
µÃµ½µÄÒ²Êǵ±Ç°ClassPathµÄ¾ø¶ÔURI·¾¶¡£
È磺file£º/D£º/java/eclipse32/workspace/jbpmtest3/bin/
5.ClassLoader.getSystemResource£¨""£©
µÃµ½µÄÒ²Êǵ±Ç°ClassPathµÄ¾ø¶ÔURI·¾¶¡£
È磺file£º/D£º/java/eclipse32/workspace/jbpmtest3/bin/
ÎÒÍƼöʹÓÃThread.currentThread£¨£©.getContextClassLoader£¨£©.getResource£¨""£©À´µÃ
µ½µ±Ç°µÄclasspathµÄ¾ø¶Ô·¾¶µÄURI±íʾ·¨¡£
ÔÚWebÓ¦ÓóÌÐòÖУ¬ÎÒÃÇÒ»°ãͨ¹ýServletContext.getRealPath£¨"/"£©·½·¨µÃµ½WebÓ¦ÓóÌÐòµÄ¸ùĿ¼µÄ¾ø¶Ô·¾¶¡£Õâ
Ñù£¬ÎÒÃÇÖ»ÐèÒªÌṩÏà¶ÔÓÚWebÓ¦ÓóÌÐò¸ùĿ¼µÄ·¾¶£¬¾Í¿ÉÒÔ¹¹½¨³ö¶¨Î»×ÊÔ´µÄ¾ø¶Ô·¾¶¡£
×¢Òâµã£º
1.¾¡Á¿²»ÒªÊ¹ÓÃÏà¶ÔÓÚSystem.getProperty£¨"user.dir"£©µ±Ç°Óû§Ä¿Â¼µÄÏà¶Ô·¾¶¡£ÕâÊÇÒ»¿Å¶¨Ê±Õ¨µ¯£¬Ëæʱ¿ÉÄÜÒªÄãµÄ
Ãü¡£
2.¾¡Á¿Ê¹ÓÃURIÐÎʽµÄ¾ø¶Ô·¾¶×ÊÔ´¡£Ëü¿ÉÒÔºÜÈÝÒ×µÄת±äΪURI£¬URL£¬File¶ÔÏó¡£
3.¾¡Á¿Ê¹ÓÃÏà¶Ôcl
Ïà¹ØÎĵµ£º
±ÏÒµÉè¼ÆÓöµ½Ò»¸öÎÊÌ⣬Èç¹û²ÅÄÜ»ñµÃ±¾»úµÄÍø¹ØµØÖ·£¬ÎÊÁ˰ٶȺÍgoogle£¬ËƺõÕÒ²»µ½´ð°¸£¬ÓÚÊÇÔÚÂÛ̳Àï·¢ÌûÎÊÀÏÄñÃÇ£¬ÔÚËûÃǵÄÌáʾÏ£¬ÊµÏÖÁË»ñÈ¡Íø¹ØµÄµØÖ·£¬ÕâÀïÖ÷ÒªÊÇͨ¹ýsnmpÐÒé¶ÁÈ¡±¾»úµÄmib¿â£¬ÒòΪOIDΪ1.3.6.1.2.1.4.21.1.7¶ÔÓ¦µÄÊÇipRouteNextHop£¬Ò²¾ÍÊÇÏÂÒ»Ìø·ÓÉ£¬¶Ô±¾»úÀ´Ëµ¾Í˵ĬÈÏÍø¹ØÁË£¬ÕâÀ ......
ÊØ»¤Ị̈߳¨Daemon£©
JavaÓÐÁ½ÖÖThread£º“ÊØ»¤Ïß³ÌDaemon”Óë“Óû§Ïß³ÌUser”¡£
ÎÒÃÇ֮ǰ¿´µ½µÄÀý×Ó¶¼ÊÇÓû§£¬ÊØ»¤Ïß³ÌÊÇÒ»ÖÖ“ÔÚºǫ́ÌṩͨÓÃÐÔÖ§³Ö”µÄỊ̈߳¬Ëü²¢²»ÊôÓÚ³ÌÐò±¾Ìå¡£
´Ó×ÖÃæÉÏÎÒÃǺÜÈÝÒ×½«ÊØ»¤Ïß³ÌÀí½â³ÉÊÇÓÉÐéÄâ»ú£¨virtual machine£©ÔÚÄÚ²¿´´½¨µÄ£¬¶øÓû§Ïß³ÌÔòÊÇ×Ô ......
1.
ÔúʵµÄ»ù´¡¡£Êý¾Ý½á¹¹¡¢ÀëÉ¢Êýѧ¡¢±àÒëÔÀí£¬ÕâЩÊÇËùÓмÆËã»ú¿ÆѧµÄ»ù´¡£¬Èç¹û²»ÕÆÎÕËûÃÇ£¬ºÜÄÑд³ö¸ßˮƽµÄ³ÌÐò¡£¾ÝÎҵĹ۲죬ѧ¼ÆËã»úרҵµÄÈ˱ÈѧÆäËû
רҵµÄÈ˸üÄÜд³ö¸ßÖÊÁ¿µÄÈí¼þ¡£³ÌÐòÈËÈ˶¼»áд£¬µ«µ±Äã·¢ÏÖдµ½Ò»¶¨³Ì¶ÈºÜÄÑÔÙÌá¸ßµÄʱºò£¬¾ÍÓ¦¸ÃÏëÏëÊDz»ÊÇÒª»Ø¹ýÍ·À´ ......
//package ÓéÀÖ;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.text.DecimalFormat;
import javax.swing ......
ÕâÁ½Ìì,ÒòΪÏîÄ¿ÐèÒª,Éæ¼°µ½Îļþ¼ÐµÄÉÏ´«,ÏëÁ˺ܾÃ,ÔÚÍøÉÏÒ²ÕÒÁËһЩ×ÊÁÏ,¶¼Ã»ÓÐʲôºÜºÃµÄ°ì·¨,¶¼ÊÇÓòå¼þÖ®ÀàµÄ½â¾ö,ºóÃæ¾ÍÏëµ½ÁËÉÏ´«Ñ¹Ëõ
Îļþ,˵µ½Ñ¹ËõÎļþ,×ÔÈ»¾Í»áÓöµ½,ÎļþµÄ½âѹËõÎÊÌâ,´ó¼Ò¶¼ÖªµÀ,±È½Ï³£¼ûµÄѹËõÎļþÓÐrar,zip,È»¶ørar,zipµÄÇø±ðÓÖÔÚÄÄ?˵һ
µã,zip ѹËõËã·¨ÊÇÃâ·Ñ¿ª·ÅµÄ£¬ÈκÎÈË¿ÉÒÔÃâ·ÑʹÓᣵ ......