摘要: 1、利用System.getProperty()函数获取当前路径:System.out.println(System.getProperty("user.dir"));//user.dir指定了当前的路径2、使用File提供的函数获取当前路径:File directory = new File("");//设定为当前文件夹try{ System.out.println(directory.getCanonicalPath());//获取标准的路径 System.out.println(directory.getAbsolutePath());//获取绝对 阅读全文
posted @ 2011-11-25 18:21 六不朽 阅读(744) 评论(0) 推荐(0) 编辑