VersionControlPath.Combine 方法 (String, String, String, PathLength)

有一個基本的本機路徑,基礎伺服器路徑和目標區域路徑計算目標伺服器路徑。 這會產生區域路徑的相對路徑完成,轉換成伺服器相對路徑和合併其與基本的伺服器路徑。 注意:,如果無法產生目標伺服器路徑,這個方法會擲回無效路徑例外狀況。 這個的可能原因包括:1) 本機路徑位於不同的磁碟並不是相對的。2) 合併計算之相對路徑與基底伺服器路徑會產生「負數資料夾深度」(即目錄頂端根, $)。 範例:合併 (@ " c:\myproj\abc\efg」, @ " c:\myproj\abc\blech」, $/foo " @」) @> " $/blech」合併 (@ " c:\myproj\abc\efg」, @ " c:\myproj\abc\efg\x」, $/bar " @」)> @ " $/efg/x」合併 (@ " c:\myproj\abc\efg」, @ " c:\yourproj\abc\efg\x」, $/bar " @」)> @ " InvalidPathException」合併 (@ " c:\myproj\abc\efg」, @ " c:\yourproj\abc\efg」, $/myproj/abc/efg」@ ")> $/yourproj/abc/efg」@ "

命名空間:  Microsoft.TeamFoundation.VersionControl.Common
組件:  Microsoft.TeamFoundation.VersionControl.Common (在 Microsoft.TeamFoundation.VersionControl.Common.dll 中)

語法

'宣告
Public Shared Function Combine ( _
    baseLocalPath As String, _
    targetLocalPath As String, _
    baseServerPath As String, _
    maxServerPathLength As PathLength _
) As String
public static string Combine(
    string baseLocalPath,
    string targetLocalPath,
    string baseServerPath,
    PathLength maxServerPathLength
)

參數

  • baseLocalPath
    類型:System.String
    來源項目的區域路徑。
  • targetLocalPath
    類型:System.String
    目標項目的區域路徑。
  • baseServerPath
    類型:System.String
    來源項目的伺服器路徑。

傳回值

類型:System.String
目標項目的絕對伺服器路徑。

.NET Framework 安全性

請參閱

參考

VersionControlPath 類別

Combine 多載

Microsoft.TeamFoundation.VersionControl.Common 命名空間