获取应用程序路径

System.getProperty("user.dir")



public class GetPath {
    public static void main(String[] args) {
        GetPath test = new GetPath();
        System.out.println(test.getPath());
    }

    public String getPath(){
        return this.getClass().getResource("/").getPath();
    }
}



File f = new File(".");
f.getCanonicalPath();

你可能感兴趣的:(F#)