It is working. \\
is not escaped whilst inspecting during debugging. Try printing the value to a console window or the webpage.
Edit* You appear to be confused.
Your path doesn't actually contain any double slashes \\
, it just looks that way because the single slashes are escaped when viewing the string during debugging. Consider reading up on Escape sequences.
If you want to escape single slashes then don't use a verbatim string literal in your replace e.g. string.Replace("\\", "-")
which would replace all single slashes in the path with a hyphen -
though I'm not sure why you would want to do this? Note that this will still show the path as having \\
slashes in it whilst inspecting during debugging. Printing to a console window would read:
C:-dev-vsprojects-VerificaionDeFirmas-VerificaionDeFirmas-verificaciondefirmas.txt