Insert a new attribute into the directory using the contents of a file as the value.
[Visual Basic] MustOverride Public Function AddFromFile( _ ByVal attributeName As String, _ ByVal filename As String _ ) As Attribute [C#] public abstract Attribute AddFromFile( string attributeName, string filename ); [C++] public: abstract Attribute* AddFromFile( String* attributeName, String* filename ); [JScript] public abstract function AddFromFile( String attributeName, String filename ): 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 using the contents of a file as the value.
AttributeCollection attributes = entries[0].Attributes;
attributes.AddFromFile("photo", "F:\\photos\\jane.jpg");
// Disconnect
client.Disconnect();
}
}
}