我写了下面的代码从给出的文件路径读取文件(使用VS2010 & C#):键入文件路径为C#中的字符串
static void Main(string[] args)
{
string temp;
string path = "C:\Windows\Temp\fmfozdom.5hn.rdl";
using(FileStream stream = new FileStream(path, FileMode.Open))
{
StreamReader r = new StreamReader(stream);
temp = r.ReadToEnd();
}
Console.WriteLine(temp);
}
编译器抱怨以下行:
string path = "C:\Windows\Temp\fmfozdom.5hn.rdl";
它给出了消息:在无法识别的转义序列\ W和\ t
我做错了什么?