我想从TFS 2013下载文件。我找到VersionControlServer
课程:msdn
但是如何初始化呢?
VersionControlServer vs;
vs.DownloadFile(repositoryPath,localPath); // vs not initialized!
谢谢!
答案 0 :(得分:3)
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);