Shibli Shibli - 15 days ago 7
C# Question

Full path with double backslash (C#)

Is it possible to get a full path with double backslash by using

Path.GetFullPath
? Something like this:

C:\\Users\\Mammamia\\Videos\\Documents\\CFD\\geo_msh\\cubeOp.txt


instead of this:

C:\Users\Mammamia\Videos\Documents\CFD\geo_msh\cubeOp.txt


Or is there any other method?

Answer

Do you mean this?

Path.GetFullPath(path).Replace(@"\", @"\\");