我有一个字符串,它给出了PNG图像的前一个源路径:asp.net替换特殊字符“”
C:\pictures\picture1.png
但我将代替“\”字符“\ \”( 2个\字符),这条线:
我的数据是C:\pictures\picture1.png
public string rep(string data)
{
data.Replace('\','\\');
return data;
}
当我仪式data.Replace( '\', '\')的下一个字符后, '\' 来描述什么行我可以做什么我必须使用文件来源如此:
C:\\pictures\\picture1.png
http:// stackove rflow.com/questions/4543686/how-to-automatically-escape-the-path – algreat 2013-03-19 14:22:10