帮我看看以下错误怎么改?Compiler Error Message: CS1009: Unrecognized escape sequence
string file_path="D:\InetPub\wwwroot\department\bs\news\counter.txt";
另,不懂C#,哪里有将C#改为VB的网站?

解决方案 »

  1.   

    自己找到了.无法识别的转义序列在 string 中反斜杠 (\) 的后面是一个意外的字符。编译器需要一个有效的转义符;有关更多信息,请参见字符转义。下面的示例生成 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";
       }
    }
    哪里可以将C#译成VB的?
      

  2.   

    string filename =@ "c:\myFolder\myFile.txt";