使用Adobe AIR从ActionScript 3中的两个绝对路径获取相对路径的最简单方法是什么?
e.g。
C:\my\first\folder
C:\my\second\folder
Relative Path from \first\folder to \second\folder:
..\..\second\folder
答案 0 :(得分:4)
你在这里:
var file1 : File = new File("C:\my\first\folder");
var file2 : File = new File("C:\my\second\folder");
var relPath : String = file1.getRelativePath(file2, true);
//relPath = ..\..\second\folder