Hi,
I need to read content from a text file which contains comma seperated values and insert/store these values in a ldap server.
can anyone please help !
this is the code that i'm currently having:
using (StreamReader sr = new StreamReader("test.txt"))
{
String line;
while ((line = sr.ReadLine()) != null)
{
listStrLineElements = line.Split(',').ToList();
}
}
DirectoryEntry entry = new DirectoryEntry("LDAP://", "username", "password");
//DirectorySearcher mySearcher = new DirectorySearcher(entry);
DirectoryEntry newUser = entry.Children.Add("CN=" + "test", "person");
newUser.Properties["cn"].Add("test");
newUser.Properties["sn"].Add("test");
newUser.CommitChanges();