TFS以编程方式注销

时间:2013-07-26 10:24:21

标签: c# tfs2012

如何从代码中退出TFS 2012(云)?

尝试了一些事情,但身份提供商总是加载相同的凭据。

更新 我试过的一些代码

ClientCredentials tfsClientCredentials = new TfsClientCredentials(false);
TfsConfigurationServer serverConfig = new TfsConfigurationServer(uri, tfsClientCredentials);
serverConfig.EnsureAuthenticated();

和第二个片段

TfsConfigurationServer serverConfig = new TfsConfigurationServer(uri, new UICredentialsProvider());
serverConfig.EnsureAuthenticated();

和第三个

ICredentialsProvider provider = new UICredentialsProvider();
WindowsCredential wcred = new WindowsCredential(cred, provider);
TfsClientCredentials tfsClientCredentials = new TfsClientCredentials(wcred);
TfsConfigurationServer serverConfig = new TfsConfigurationServer(uri, tfsClientCredentials);
serverConfig.EnsureAuthenticated();

0 个答案:

没有答案