javaÖлñÈ¡Îļþ·¾¶µÄ¼¸ÖÖ·½Ê½
¹ØÓÚ¾ø¶Ô·¾¶ºÍÏà¶Ô·¾¶£º
¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺C:xyz est.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸öURL¾ø¶Ô·¾¶¡£Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚServletÖУ¬"/"´ú±íWebÓ¦ÓõĸúĿ¼¡£ºÍÎïÀí·¾¶µÄÏà¶Ô±íʾ¡£ÀýÈ磺"./" ´ú±íµ±Ç°Ä¿Â¼,"../"´ú±íÉϼ¶Ä¿Â¼¡£ÕâÖÖÀàËƵıíʾ£¬Ò²ÊÇÊôÓÚÏà¶Ô·¾¶¡£ÁíÍâ¹ØÓÚURI£¬URL,URNµÈÄÚÈÝ£¬Çë²Î¿¼RFCÏà¹ØÎĵµ±ê×¼¡£RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax,(http://www.ietf.org/rfc/rfc2396.txt)2.¹ØÓÚJSP/ServletÖеÄÏà¶Ô·¾¶ºÍ¾ø¶Ô·¾¶¡£2.1·þÎñÆ÷¶ËµÄµØÖ··þÎñÆ÷¶ËµÄÏà¶ÔµØÖ·Ö¸µÄÊÇÏà¶ÔÓÚÄãµÄwebÓ¦ÓõĵØÖ·£¬Õâ¸öµØÖ·ÊÇÔÚ·þÎñÆ÷¶Ë½âÎöµÄ£¨²»Í¬ÓÚhtmlºÍjavascriptÖеÄÏà¶ÔµØÖ·£¬ËûÃÇÊÇÓÉ¿Í»§¶Ëä¯ÀÀÆ÷½âÎöµÄ£©
µÚÒ»ÖÖ£º
File f = new File(this.getClass().getResource("/").getPath());
System.out.println(f);
½á¹û:
C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin
»ñÈ¡µ±Ç°ÀàµÄËùÔÚ¹¤³Ì·¾¶;
Èç¹û²»¼Ó“/”
File f = new File(this.getClass().getResource("").getPath());
System.out.println(f);
½á¹û£º
C:\Documents%20and%20Settings\Administrator\workspace\projectName\bin\com\test
»ñÈ¡µ±Ç°ÀàµÄ¾ø¶Ô·¾¶£»
µÚ¶þÖÖ£º
File directory = new File("");//²ÎÊýΪ¿Õ
String courseFile = directory.getCanonicalPath() ;
System.out.println(courseFile);
½á¹û£º
C:\Documents and Settings\Administrator\workspace\projectName
»ñÈ¡µ±Ç°ÀàµÄËùÔÚ¹¤³Ì·¾¶;
µÚÈýÖÖ£º
URL xmlpath = this.getClass().getClassLoader().getResource("selected.txt");
System.out.println(xmlpath);
½á¹û£º
file:/C:/Documents%20and%20Settings/Administrator/workspace/projectName/bin/selected.txt
»ñÈ¡µ±Ç°¹¤³ÌsrcĿ¼ÏÂselected.txtÎļþµÄ·¾¶
µÚËÄÖÖ£º
System.out.println(System.getProperty("user.dir"));
½á¹û£º
C:\Documents and Settings\Administrator\workspace\projectName
»ñÈ¡µ±Ç°¹¤³Ì·¾¶
µÚÎåÖÖ£º
System.out.println( System.getProperty("java.class.path"));
½á¹û£º
C:\Documents and Settings\Administrator\w
Ïà¹ØÎĵµ£º
Ô´´úÂ룺
import java.applet.Applet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class brandishString extends Applet implements Runnable, MouseListener {
String str; // ÒªÏÔʾµÄ×Ö·û ......
Ò»¸öjavaµÄclassÎļþÊÇÒ»¸ö¶þ½øÖÆÎļþ£¬ÆäÖÐÇ°Ëĸö×Ö½ÚÊÇmagic룬µÚÎåµ½µÚÁù¸ö×Ö½Ú¶ÔÓ¦ÓÚminorºÍmajor£¬ÏÂÃæÊÇÕâ¸öÀàÎļþ°æ±¾ÓëJDKµÄ¶ÔÓ¦¹Øϵ¡£classÎļþµÄminorºÍmajor¿ÉÒÔͨ¹ýultraeditÀ´²é¿´£¬»ò×Ô¼º±à³ÌµÈ¡£
major minor Java platform version
45 3 1.0
45 3 1.1
46 0 ......
¿´µ½Õâƪ¹ØÓÚJava¶à̬µÄÌû×Ó£¬¾õµÃºÜ¶à£¬»ù±¾º¸ÇÁËJava¶à̬µÄ¸÷ÖÖ³¡¾°£¬ÕâÀïת¸ø´ó¼Ò²Î¿¼£º
http://blog.csdn.net/thinkghoster/archive/2008/04/19/2307001.aspx
ÉîÈëÀí½âjava¶à̬ÐÔ
×òÌì¿´µ½Ò»¸ö¹ØÓÚ¶à̬ÐÔµÄÌû×Ó£¬²Î¿¼ÁË»ØÌûÕßµÄÀí½â£¬¼ÓÈëÁËһЩ×Ô¼ºµÄ¿´·¨£¬ÕûÀí ......
import java.util.Properties;
import javax.mail.FetchProfile;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.internet.InternetAddress;
public class ReceiveMail
{
public ReceiveMai ......
»Øµ÷¸ÅÄî:
Èí¼þÄ£¿éÖ®¼ä×ÜÊÇ´æÔÚ×ÅÒ»¶¨µÄ½Ó¿Ú£¬´Óµ÷Ó÷½Ê½ÉÏ£¬¿ÉÒÔ°ÑËûÃÇ·ÖΪÈýÀࣺͬ²½µ÷Óᢻص÷ºÍÒì²½µ÷Óá£Í¬²½µ÷ÓÃÊÇÒ»ÖÖ×èÈûʽµ÷Ó㬵÷Ó÷½ÒªµÈ´ý¶Ô·½Ö´ÐÐÍê±Ï²Å·µ»Ø£¬ËüÊÇÒ»ÖÖµ¥Ïòµ÷Ó㻻ص÷ÊÇÒ»ÖÖË«Ïòµ÷ÓÃģʽ£¬Ò²¾ÍÊÇ˵£¬±»µ÷Ó÷½ÔÚ½Ó¿Ú±»µ÷ÓÃʱҲ»áµ÷ÓöԷ½µÄ½Ó¿Ú£»Òì²½µ÷ÓÃÊÇÒ»ÖÖÀàËÆÏûÏ¢»òʼþµÄ»úÖÆ£¬² ......