比如
File f = new File("C:\\Program Files\\Java\\WORKSPACE\\loc\\config.inc.php");
String str1 = f.getAbsolutePath();
str1就是C:\\Program Files\\Java\\WORKSPACE\\loc\\config.inc.php,但是我想要的path是C:\\Program Files\\Java\\WORKSPACE\\loc。
有 什么好办法么?
比如随便打一个文件,如f,就能找出我想要的path,可以么?先谢谢了!
File f = new File("C:\\Program Files\\Java\\WORKSPACE\\loc\\config.inc.php");
String str1 = f.getAbsolutePath();
str1就是C:\\Program Files\\Java\\WORKSPACE\\loc\\config.inc.php,但是我想要的path是C:\\Program Files\\Java\\WORKSPACE\\loc。
有 什么好办法么?
比如随便打一个文件,如f,就能找出我想要的path,可以么?先谢谢了!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货