简体   繁体   English

我应该如何组合两条路径,包括向后相对路径?

[英]How should I combine two paths including backwards relative paths?

I have an absolute path, and a relative path, and I want to combine the two, is there any built-in way? 我有一个绝对的路径,一个相对的路径,我想把两者结合起来,有没有内置的方法?

The relative path can be as well " ../../aa2/file.exe ". 相对路径也可以是“ ../../aa2/file.exe ”。

( path.combine does not support it - which is pretty bizarre by itself.) path.combine不支持它 - 这本身就很奇怪。)

尝试Path.GetFullPath(Path.Combine(abs, rel))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM