Share via


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

有一個基本的本機路徑,基礎伺服器路徑和目標區域路徑計算目標伺服器路徑。 這會產生區域路徑的相對路徑完成,轉換成伺服器相對路徑和合併其與基本的伺服器路徑。

注意:,如果無法產生目標伺服器路徑,這個方法會擲回無效路徑例外狀況。 這個的可能原因包括:

1) 本機路徑位於不同的磁碟並不是相對的。

2) 合併計算之相對路徑與基礎伺服器路徑產生目錄頂端根的「負數資料夾深度」$ (,)。

範例:合併 (@ " c:\myproj\abc\xyz」, @ " c:\myproj\abc\blech」, @ " $/abc」) - > @ " $/blech」合併 (@ " c:\myproj\abc\xyz」, @ " c:\myproj\abc\xyz\x」, $/xyz」@ ") > @ " $/xyz/x」合併 (@ " c:\myproj\abc\xyz」, @ " c:\yourproj\abc\xyz\x」, $/xyz」@ ") > @ " InvalidPathException」合併 (@ " c:\myproj\abc\xyz」, @ " c:\yourproj\abc\xyz」, $/myproj/abc/xyz」@ ") > @ " $/yourproj/abc/xyz」

命名空間:  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 _
) As String
public static string Combine(
    string baseLocalPath,
    string targetLocalPath,
    string baseServerPath
)

參數

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

傳回值

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

.NET Framework 安全性

請參閱

參考

VersionControlPath 類別

Combine 多載

Microsoft.TeamFoundation.VersionControl.Common 命名空間