private String getPath() {
// String name = this.getClass().getName().replaceAll("\\.", "/");
// String resourcename = null;
// if (name.lastIndexOf("/") >= 0)
// resourcename = name.substring(name.lastIndexOf("/") + 1);
// else
// resourcename = name;
// String path = this.getClass().getResource(resourcename + ".class").getFile();
// if (path.indexOf(name) > 0)
// path = path.substring(0, path.indexOf(name));
String path = System.getProperty("user.dir");
return path;
}
// String name = this.getClass().getName().replaceAll("\\.", "/");
// String resourcename = null;
// if (name.lastIndexOf("/") >= 0)
// resourcename = name.substring(name.lastIndexOf("/") + 1);
// else
// resourcename = name;
// String path = this.getClass().getResource(resourcename + ".class").getFile();
// if (path.indexOf(name) > 0)
// path = path.substring(0, path.indexOf(name));
String path = System.getProperty("user.dir");
return path;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货