C# 怎样将路径中的\替换为\\?? 例如我有 string = “c:\windows\123.txt”;请问怎样替换为“c:\\windows\\123.txt”??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 替换的原因是什么啊 ?可以直接这样用啊string = @“c:\windows\123.txt”; s. Replace("\\", "\\\\"); @"c:\windows\123.txt" string = @"c:\windows\123.txt";Regex.Replace(str,@"\","\\\\") string a=@"c:\windows\123.txt"; string b = a.Replace("\\","\\\\"); Console.WriteLine(a); Console.WriteLine(b); string = “c:\windows\123.txt”;编译都无法通过 string = @“c:\windows\123.txt”; string str = @"c:\windows\123.txt";str = str.Replace("\\","\\\\");或者str = str.Replace(@"\",@"\\");或者str = str.Replace(@"\","\\\\");或者str = str.Replace("\\",@"\\"); 时间转型 关于映射和反映射的问题 希望高手来班忙一下 请教个有关部署SQL CLR的问题.急!!! 数组排序问题!!! IEnumerator winform中的两个form窗体之间picturebox传值 谁能告诉我下面这段程序的执行过程,并有什么办法做个按钮,点击能使界面图片清空?? .net工作环境中窗口状态栏设置的问题? Form的ControlBox属性为false时的怪问题 在C#中类Directory和DirectoryInfo有什么区别?高人求解,通俗一点讲 利用飞信真能做到不用netframework吗? 我的C#小小的愿望~!!!!!!!!!!
Regex.Replace(str,@"\","\\\\")
string b = a.Replace("\\","\\\\");
Console.WriteLine(a);
Console.WriteLine(b);
编译都无法通过
string = @“c:\windows\123.txt”;
str = str.Replace("\\","\\\\");
或者
str = str.Replace(@"\",@"\\");
或者
str = str.Replace(@"\","\\\\");
或者
str = str.Replace("\\",@"\\");