更新:2007 年 11 月
错误消息
无法识别的转义序列在 
下面的示例生成 CS1009:
// CS1009-a.cs
class MyClass
{
   static void Main()
   {
      string a = "\m";   // CS1009
      // try the following line instead
      // string a = "\t";
   }
} | |
发生该错误的原因通常是在文件名中使用了反斜杠字符,例如:
string filename = "c:\myFolder\myFile.txt";  | |
若要纠正该错误,请使用“\\”或前面带有 @ 且用引号括起的字符串,如下面的示例所示:
// CS1009-b.cs
class MyClass
{
   static void Main()
   {
      string filename = "c:\myFolder\myFile.txt";   // CS1009
      // try the one of the following lines instead
      // string filename = "c:\\myFolder\\myFile.txt";
      // string filename = @"c:\myFolder\myFile.txt";
   }
} | |