当我使用
 String str="c:\aa.xls";
 str=str.Replace("\","\\");时,括号为红色错误的,那么如何才能替换成"\\"呢,双引号里的内容

 

解决的方法:

1.String str=@"c:\aa.xls";
str = str.Replace(@"\", @"\\");

2.string i = @"c:\aa.xls";

Response.Write(i.Replace("\\","\\\\"));

相关文章: