如何自动逃生路径 [英] how to automatically escape the path
本文介绍了如何自动逃生路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样一个路径字符串 C:\用户\测试\ test.jpg放在
,我怎么可以把它 C:\\用户\ \测试\\ test.jpg放在
?
解决方案
字符串s = s.Replace(@\,@\\);
I have a path string like c:\user\test\test.jpg
, how can I make it c:\\user\\test\\test.jpg
?
解决方案
string s = s.Replace(@"\", @"\\");
这篇关于如何自动逃生路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文