Insert a new attribute into the directory with a string value.
[Visual Basic] MustOverride Public Function Add( _ ByVal attributeName As String, _ ByVal value As String _ ) As Attribute [C#] public abstract Attribute Add( string attributeName, string value ); [C++] public: abstract Attribute* Add( String* attributeName, String* value ); [JScript] public abstract function Add( String attributeName, String value ): Attribute;
New attribute.
[C#] using System;
using LdapServices.Ldap;
namespace LDAPSampleCodeConsole
{
class SampleApp
{
static void Main(string[] args)
{
Client client = new Client();
// Connect to the directory
client.Connect("directory.yourCompany.ca");
// Retrieve an entry to add an attribute
EntryCollection entries = client.Search("ou=people,o=yourCompany,c=ca", "cn=Jane");
// Insert a new attribute into the directory with a string value
AttributeCollection attributes = entries[0].Attributes;
attributes.Add("mail", "jane@yourCompany.ca");
// Disconnect
client.Disconnect();
}
}
}