我已经看到了相反的情况。但这一个我无法捕捉。我正在尝试获取Web资源路径的一部分并将其与本地路径结合使用。 让我再解释一下。将“/”更改为“”[C#]
public string GetLocalPath(string URI, string webResourcePath, string folderWatchPath) // get the folderwatcher path to work in the local folder
{
string changedPath = webResourcePath.Replace(URI, "");
string localPathTemp = folderWatchPath + changedPath;
string localPath = localPathTemp.Replace(@"/",@"\");
return localPath;
}
但是,当我这样做的结果是一样
C:\\Users
但我想有是
C:\Users
不 “\\” 但我调试显示它像C:\\Users
但在控制台中显示它,因为我期望它。 我想知道对于 感谢的原因..
Windows支持格式为“C:\ Users”和“C:/ Users”的路径名。根本不需要转换。 –