Add Method
Adds an entry specified by DN to the directory server using the type and value attributes defined in the Attributes properties.
Syntax
[VB.NET] Public Sub Add()
[C#] public void Add();
Remarks
This method adds the entry specified by DN to the directory. All Entries are required to have an objectClass attribute.
In order to add a new entry, first Bind with credentials that will allow you to perform the new addition. To add attributes instead of entries, use the Modify method instead. When specifying multi-valued attributes, specify the attribute type only in the first occurrence of that attribute type in the Attributes collection . Additional occurrences of the same attribute type should specify an attribute type of empty string.
The result of the operation is returned via the Result event.
Example (Add a New Entry, including the multi-valued objectClass attribute)
LDAPControl.DN = "uid=NewUser,ou=Employees,dc=server" LDAPControl.Attributes.Add(new LDAPAttribute("objectClass", "top")) LDAPControl.Attributes.Add(new LDAPAttribute("", "person")) LDAPControl.Attributes.Add(new LDAPAttribute("", "organizationalPerson")) LDAPControl.Attributes.Add(new LDAPAttribute("", "inetorgperson")) LDAPControl.Attributes.Add(new LDAPAttribute("sn", "UserName")) LDAPControl.Attributes.Add(new LDAPAttribute("cn", "New S. UserName")) LDAPControl.Attributes.Add(new LDAPAttribute("uid", "NewUser")) LDAPControl.Add()NOTE: This method has a corresponding asynchronous version (AddAsync) for use in the WinRT environment.