如何初始化 VersionControlServer 类? [英] How to init VersionControlServer class?

查看:53
本文介绍了如何初始化 VersionControlServer 类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

但是如何初始化呢?

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

谢谢!

推荐答案

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

这篇关于如何初始化 VersionControlServer 类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆