Best practice for building file paths in C#

后端 未结 2 1689
春和景丽
春和景丽 2021-01-07 16:27

I\'m working on a C# project where I must build paths to various files and folders. These are all under one root folder which I have specified in my Web.config file.

<
2条回答
  •  不思量自难忘°
    2021-01-07 17:19

    Use Path.Combine to concatenate path tokens.

    If the path is a file to set/change the extension use Path.ChangeExtension.

提交回复
热议问题