import java.io.File;
public class LocalPath {
/**
* 得到文件的当前路径
* @param args
*/
public static String GetCurrentPath()
{
return System.getProperty("user.dir",".");
}
public static void main(String[] args) {
System.out.println(System.getProperty("user.dir","."));
File file = new File(".");
String s = file.getPath();
System.out.println(s);
System.out.println(file.getAbsolutePath());
}
}
public class LocalPath {
/**
* 得到文件的当前路径
* @param args
*/
public static String GetCurrentPath()
{
return System.getProperty("user.dir",".");
}
public static void main(String[] args) {
System.out.println(System.getProperty("user.dir","."));
File file = new File(".");
String s = file.getPath();
System.out.println(s);
System.out.println(file.getAbsolutePath());
}
}