Full path with double backslash (C#)

前端 未结 4 1791
感动是毒
感动是毒 2020-12-10 05:39

Is it possible to get a full path with double backslash by using Path.GetFullPath? Something like this:

C:\\\\Users\\\\Mammamia\\\\Videos\\\\Doc         


        
4条回答
  •  半阙折子戏
    2020-12-10 06:21

    I would recommend doing a String.replace(). I recently had to do this in a project for myself. So if you do something similar to:

    String input = Path.GetFullPath(x);
    input = input.Replace("\\","\\\\");
    

    I am fairly confident that is what you need :)

    Documentation: http://msdn.microsoft.com/en-us/library/fk49wtc1.aspx

提交回复
热议问题