Using / or \\ for folder paths in C#

后端 未结 5 2029
野的像风
野的像风 2020-12-10 11:13

When writing file paths in C#, I found that I can either write something like \"C:\\\" or \"C:/\" and get the same path. Which one is recommended? I heard somewhere that usi

5条回答
  •  眼角桃花
    2020-12-10 11:54

    I write paths in C# like this:

    @"C:\My\Path"

    The @ character turns off \ escaping.

提交回复
热议问题