【问题标题】:How to init VersionControlServer class?如何初始化 VersionControlServer 类?
【发布时间】:2023-03-25 20:49:01
【问题描述】:

我想从 TFS 2013 下载文件。我找到了 VersionControlServer 类:msdn

但是如何初始化呢?

 VersionControlServer vs;
 vs.DownloadFile(repositoryPath,localPath); // vs not initialized!

谢谢!

【问题讨论】:

    标签: c# version-control tfs repository


    【解决方案1】:
    String repositoryPath = "$/MyColl1/Folder1/Folder2/TargetFile.txt";
        String localPathStored = Environment.CurrentDirectory + "/" + "TargetFile.txt";
        String uriSite = "http://tfs-server:8080/tfs/../../vN.0/....asmx";
        TfsTeamProjectCollection teamProjectCollection =TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(uriSite));
    
        VersionControlServer versionControlServer = teamProjectCollection.GetService<VersionControlServer>();
        versionControlServer.DownloadFile(repositoryPath, localPathStored);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-23
      • 2011-03-16
      • 2011-04-11
      • 1970-01-01
      • 1970-01-01
      • 2017-03-24
      • 1970-01-01
      • 2011-07-03
      相关资源
      最近更新 更多