Windows Phone Developers

Showing posts with label C# Error CS1009. Show all posts
Showing posts with label C# Error CS1009. Show all posts

Saturday, September 6, 2008

Unrecognized escape sequence (error CS1009)

A common case for this error is using the backslash character in a file name. Replace “\” with “\\” or use “@” prefix for the literal as shown below




Error



StreamWriter SW = new StreamWriter("c:\shasurdata\forblogger\Sample.txt");


Corrected



StreamWriter SW = new StreamWriter("c:\\shasurdata\\forblogger\\Sample.txt");



Or



StreamWriter SW = new StreamWriter(@"c:\shasurdata\forblogger\Sample.txt");



Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon