TfsConfigurationServer 생성자 (Uri, IdentityDescriptor)
TfsConfigurationServer 개체의 새 인스턴스를 초기화합니다.
네임스페이스: Microsoft.TeamFoundation.Client
어셈블리: Microsoft.TeamFoundation.Client(Microsoft.TeamFoundation.Client.dll)
구문
‘선언
Public Sub New ( _
uri As Uri, _
identityToImpersonate As IdentityDescriptor _
)
public TfsConfigurationServer(
Uri uri,
IdentityDescriptor identityToImpersonate
)
매개 변수
- uri
형식: System.Uri
서버를 실행 하는 범용 리소스 식별자 (URI) Team Foundation Server.
- identityToImpersonate
형식: Microsoft.TeamFoundation.Framework.Client.IdentityDescriptor
가장 하는 id입니다.
예외
예외 | 조건 |
---|---|
ArgumentNullException | 때 uri 이 null |
설명
이 생성자를 사용 하는 코드를 실행 하려면 프로세스 "다른 사용자 대신 요청 만들기" 권한이 있어야 합니다. 가장에 대 한 자세한 내용은 참조 콘솔 응용 프로그램에서 Team Foundation Server에 연결.
// Connect to Team Foundation Server
// server is the name of the server that is running the Team Foundation application-tier.
// port is the port that Team Foundation uses. The default port is 8080.
// vdir is the virtual path to the Team Foundation application. The default path is tfs.
Uri tfsUri = (args.Length < 1) ?
new Uri("http://server:port/vdir") : new Uri(args[0]);
// Connect to the server without impersonation
TfsConfigurationServer baseUserConnection = new TfsConfigurationServer(tfsUri);
// Get the identity management service
IIdentityManagementService ims = baseUserConnection.GetService<IIdentityManagementService>();
// Get the identity to impersonate
TeamFoundationIdentity identity = ims.ReadIdentity(IdentitySearchFactor.AccountName, @"DOMAIN\user",
MembershipQuery.None, ReadIdentityOptions.None);
// Connect using the impersonated identity
TfsConfigurationServer impersonatedConnection = new TfsConfigurationServer(tfsuri,
identity.Descriptor);
.NET Framework 보안
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.
참고 항목
참조
Microsoft.TeamFoundation.Client 네임스페이스