当我想添加目录时,我通过ldap连接连接到linux系统 我有一个问题,添加到EntryDirectory的子, myDirectoryEntry.CommitChanges();有例外
static void Add(DirectoryEntry entry)
{
DirectoryEntries myEntries = entry.Children;
DirectoryEntry myDirectoryEntry = myEntries.Add("AccountNumber=3", "simpleSecurityObject");
myDirectoryEntry.Properties["sn"].Value = 3;
myDirectoryEntry.Properties["firstname"].Value = "test name";
myDirectoryEntry.Properties["lastname"].Value = "test family";
myDirectoryEntry.CommitChanges();
entry.CommitChanges();
Console.WriteLine(myDirectoryEntry.Name + " entry is created in container.");
}