gpt4 book ai didi

c# - 如何将相对路径转换为 ​​C#/.NET 中的完全限定路径?

转载 作者:太空狗 更新时间:2023-10-29 20:00:45 25 4
gpt4 key购买 nike

假设我有一个定义为“....................\bin\prices.xls”的文件名,是否有一种简单的方法可以将其转换为完全限定路径(一个包括驱动器号、冒号和文件的所有文件夹)?

最佳答案

尝试 Path.GetFullPath() :

Returns the absolute path for the specified path string.

The absolute path includes all information required to locate a file or directory on a system.

关于c# - 如何将相对路径转换为 ​​C#/.NET 中的完全限定路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2162292/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com