public void Stuff() { string myLDAPPath = "ldap://ldap.toshok.org"; try { Mono.Directory.LDAP.LDAP ld = new Mono.Directory.LDAP.LDAP(myLDAPPath); LDAPMessage res, entry; string[] attrs = { "+", null }; /* don't bind, we do this anonymously */ ld.Search("" /* root dse */, SearchScope.Base, "(objectclass=*)", attrs, false, TimeSpan.FromSeconds(10), 0 /* no size limit */, out res); if (res == null) { Console.WriteLine("the search failed"); } Console.WriteLine("There are {0} entries", res.CountEntries()); entry = res.FirstEntry(); if (entry == null) { Console.WriteLine("null returned from res.FirstEntry"); } string[] extensions = entry.GetValues("supportedExtension"); if (extensions != null) { foreach (String e in extensions) { Console.WriteLine("Supported Extension: {0}\n", e); } } else { Console.WriteLine("null returned from entry.GetValues\n"); } } catch (Exception e) { Console.WriteLine("The '" + myLDAPPath + "' path not found."); Console.WriteLine("Exception : " + e.Message); Console.WriteLine(e.StackTrace); } }
public void Stuff() { string myLDAPPath = "ldap://ldap.toshok.org"; string username = "******", passwd = "evotest"; try { Mono.Directory.LDAP.LDAP ld = new Mono.Directory.LDAP.LDAP (myLDAPPath); ld.BindSimple (username, passwd); Console.WriteLine("Successfully bound {0} at {1}", username, myLDAPPath); } catch(Exception e) { Console.WriteLine("The '" + myLDAPPath + "' path not found."); Console.WriteLine("Exception : " + e.Message); } }
public void Stuff() { string myLDAPPath = "ldap://ldap.toshok.org"; string username = "******", passwd = "evotest"; try { Mono.Directory.LDAP.LDAP ld = new Mono.Directory.LDAP.LDAP(myLDAPPath); ld.BindSimple(username, passwd); Console.WriteLine("Successfully bound {0} at {1}", username, myLDAPPath); } catch (Exception e) { Console.WriteLine("The '" + myLDAPPath + "' path not found."); Console.WriteLine("Exception : " + e.Message); } }
public void Stuff() { string myLDAPPath = "ldap://ldap.toshok.org"; try { Mono.Directory.LDAP.LDAP ld = new Mono.Directory.LDAP.LDAP (myLDAPPath); LDAPMessage res, entry; string[] attrs = { "+", null }; /* don't bind, we do this anonymously */ ld.Search ("" /* root dse */, SearchScope.Base, "(objectclass=*)", attrs, false, TimeSpan.FromSeconds(10), 0 /* no size limit */, out res); if (res == null) { Console.WriteLine ("the search failed"); } Console.WriteLine ("There are {0} entries", res.CountEntries()); entry = res.FirstEntry(); if (entry == null) Console.WriteLine ("null returned from res.FirstEntry"); string[] extensions = entry.GetValues ("supportedExtension"); if (extensions != null) { foreach( String e in extensions ) Console.WriteLine ("Supported Extension: {0}\n", e); } else { Console.WriteLine ("null returned from entry.GetValues\n"); } } catch(Exception e) { Console.WriteLine("The '" + myLDAPPath + "' path not found."); Console.WriteLine("Exception : " + e.Message); Console.WriteLine(e.StackTrace); } }
internal LDAPMessage(LDAP ld, IntPtr ldm) { this.ld = ld; this.ldm = ldm; }