我有以下命令:爲什麼這個Path.Combine不能工作?
string reportedContentFolderPath =
Path.Combine(contentFolder.FullName.ToString(), @"\ReportedContent\");
當我看到在調試器,我可以看到以下內容:
contentFolder.FullName = "E:\\"
然而
reportedContentFolderPath = "\\ReportedContent\\"
爲什麼Path.Combine
斬去對E :\?
嘗試不用''reportedContentFolderPath'上的斜槓 – Mrchief
CHeck out this previous answer http://stackoverflow.com/questions/53102/why-does-path-combine-not-properly-concatenate-filenames-that-start-與路徑-DIR –