c#中转义用\表示。
例如,\t表示制表符。
@表示不转义,连换行符都不会转义。
//引入system命名空间 using System; //和程序名相同的命名空间 //在常见项目时就自动生成 namespace the_second_helloworld { //类program,在创建项目时自动生成 class Program { //主函数,程序执行的起点 static void Main(string[] args) { //声明一个string,用转义表示 string file_path1 = "d:\\aaa"; //声明另一个string,不用转义 string file_path2 = @"d:\aaa"; //不用转义,连换行都不会转义 string str = @"123 456"; Console.WriteLine(file_path1); Console.WriteLine(file_path2); Console.WriteLine(str); } } } 运行结果: d:\aaa d:\aaa 123 456