How to init VersionControlServer class?

☆樱花仙子☆ 提交于 2019-12-08 04:00:11

问题


I want to download file from TFS 2013. I found the VersionControlServer class: msdn

But how to initialize it?

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

Thank you!


回答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);


来源:https://stackoverflow.com/questions/26796307/how-to-init-versioncontrolserver-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!