Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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();
Posted
Comments
Jameel VM 29-Aug-13 9:42am    
what is the pblm?where you are stuck?
Ramesh Sreeram 29-Aug-13 9:47am    
i'm able to read the content frm txt file, able to connect ldap, but stuck at 'how to link the details in array/list into ldap server'.

please help me!
Jameel VM 29-Aug-13 9:56am    
what is the error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900