Chris R. Timmons
A single backslash in a C# string is interpreted as an escapeSvt said:Hello,
I am creating web service to save file document and I
need to specify <file path>. What is the correct syntax
It should be:
string sFile = "<file path>";
string sFile = "C:\MyDocuments\test_app.txt\";
and I get an error: Unrecognized escape sequence.
If you want C# to treat the backslash character as a literal, either
double up the backslash:
string sFile = "C:\\MyDocuments\\test_app.txt\\";
or prepend the string with the @ character:
string sFile = @"C:\MyDocuments\test_app.txt\";
Hope this helps.