简体   繁体   English

使用c#的TFS API

[英]TFS API using c#

I have find all collection from TFS all are fine. 我发现TFS的所有收藏都很好。 but i am not Understand why get username and password in windows security essential dialog to save TFS username and Password and URL . 但我不明白为什么在Windows安全必备对话框中获取用户名和密码以保存TFS用户名和密码和URL。 Please share to me . 请分享给我。 This is one main problem in client machine. 这是客户机中的一个主要问题。

Sample code 示例代码

Uri configurationServerUri = new Uri("http://your-server:8080/tfs");
TfsConfigurationServer configurationServer = TfsConfigurationServerFactory.GetConfigurationServer(configurationServerUri);
ITeamProjectCollectionService tpcService = configurationServer.GetService<ITeamProjectCollectionService>();
foreach (TeamProjectCollection tpc in tpcService.GetCollections())
{
   List.add(tpc .name);
}

windows screen 窗户屏幕

在此输入图像描述

尝试使用TfsConfigurationServer构造函数(Uri,ICredentials)而不是TfsConfigurationServer Constructor (Uri) ,然后您可以指定用于向服务器验证用户身份的凭据,如@Lasse V. Karlsen在评论中提到的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM