【发布时间】:2018-05-30 05:00:18
【问题描述】:
我正在尝试将filepath 传递给xcopy command 以将文件夹从一个位置复制到另一个位置(CodedUI using C#)。
虽然做同样的问题是,我试图在路径周围添加双引号,但它没有采用正确的路径格式。
Code:
string Path = "Some path to folder location";
// Tried all these solutions
Path = '\"' + Path + '\"';
Path = '\"' + Path + '\"';
Path = string.Format("\"{0}\"", Path );
预期:""Some path to folder location""
实际:"\"Some path to folder location"\"
请帮忙。
【问题讨论】:
-
这个也是:Path = "\"" + Path + "\"";
-
您的预期输出是“文件夹位置的某个路径”。我说的对吗?
-
@Doruk 就是这样。
标签: c# coded-ui-tests xcopy