Checks if an attribute exists in the collection. Attribute name is case-sensitive.
[Visual Basic] MustOverride Public Function Exists( _ ByVal attributeName As String _ ) As Boolean [C#] public abstract bool Exists( string attributeName ); [C++] public: abstract bool Exists( String* attributeName ); [JScript] public abstract function Exists( String attributeName ): bool;
true if attribute exists; otherwise false.
[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.yourServer.ca");
// Search the directory for entries with surname starting with 'Ab'
EntryCollection entries = client.Search("o=yourCompany,c=ca", "sn=Ab*");
// Does the cn Attribute exist?
AttributeCollection attributes = entries[0].Attributes;
Console.WriteLine("cn attribute Exists: " + attributes.Exists("cn"));
client.Disconnect();
}
}
}