JPS,
Did you look at the output? If you use "\\", you will find in the final
output that there is only one "\". The slash is an escape character for
strings in C# (unless you use the literal specifier @ before the string),
and because of that, if you want a single backslash, you need to have two in
the string.
That being said, these two statements are equivalent in C#:
str = "\\\\somemachine\\someshare\\somefile.txt";
str = @"\\somemachine\someshare\somefile.txt";
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"JPS" <jp*****@yahoo.comwrote in message
news:11********************@p77g2000hsh.googlegrou ps.com...
>I need to build a string with just one backslash included "\", but I
keep getting an error message unless I use "\\". The double
backslashes will not work with what I am doing.