TfsConfigurationServer Oluşturucu (Uri, IdentityDescriptor)
TfsConfigurationServer nesnenin yeni bir örneğini başlatır.
Ad alanı: Microsoft.TeamFoundation.Client
Derleme: Microsoft.TeamFoundation.Client (Microsoft.TeamFoundation.Client.dll içinde)
Sözdizimi
'Bildirim
Public Sub New ( _
uri As Uri, _
identityToImpersonate As IdentityDescriptor _
)
public TfsConfigurationServer(
Uri uri,
IdentityDescriptor identityToImpersonate
)
Parametreler
- uri
Tür: System.Uri
Team Foundation Server çalıştıran sunucunun evrensel kaynak tanımlayıcısı (URI).
- identityToImpersonate
Tür: Microsoft.TeamFoundation.Framework.Client.IdentityDescriptor
Bürünülecek kimlik.
Özel Durumlar
Exception | Koşul |
---|---|
ArgumentNullException | uri null olduğunda |
Notlar
Bu oluşturucu kullanan kod çalıştırmak için işlem "Yapma isteklerinin başkaları adına" izni olmalıdır.Kimliğe bürünme hakkında daha fazla bilgi için bkz: Bir Konsol Uygulamasından Team Foundation Server'a Bağlanma.
// 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 Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen Güvenilen Koddan Kitaplıkları Kullanma.
Ayrıca bkz.
Başvuru
TfsConfigurationServer Fazla Yük
Microsoft.TeamFoundation.Client Ad Alanı