当前位置:首页 > C#教程 > C#高级

C# Path

        var filePath = @"c:doc1.txt";
var dirPath1 = @"c:music";
var dirPath2 = @"c:movie";

    

路径拼接

        Console.WriteLine(Path.Combine(dirPath1, "a.mp3")); //c:musica.mp3
Console.WriteLine(Path.Combine(dirPath2, "b.mp4")); //c:movieb.mp4



    

原文:https://www.cnblogs.com/trykle/p/14505546.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐