1
Ich habe mit dem folgenden zu kämpfen, das ist, was ich jetzt habe und es funktioniert aber.Wechsel zwischen sicheren und nicht sicheren DirectoryServices.AccountManagement.PrincipalContext
public PrincipalContext getPrincipalContext(bool secured)
{
PrincipalContext oPrincipalContext = new PrincipalContext(ContextType.Domain,
secured ? DomainName + ":636" : DomainName,
Container,
secured ? ContextOptions.SecureSocketLayer | ContextOptions.Negotiate : ContextOptions.SimpleBind,
userName,
password);
return oPrincipalContext;
}
wollen wie dieses Ich denke
secured ? PrincipalContext oPrincipalContext = new PrincipalContext(ContextType.Domain,
DomainName + ":636",
Container,
ContextOptions.SecureSocketLayer | ContextOptions.Negotiate
userName,
password);
:
PrincipalContext oPrincipalContext = new PrincipalContext(ContextType.Domain,
DomainName,
Container,
ContextOptions.SimpleBind);
return oPrincipalContext;
etwas zu tun, das möglich ist, aber es nicht bekommen kann zu kompilieren. Kann mir jemand mit dem richtigen Weg helfen?
verwenden, das ist genau das, was ich gesucht –