Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
GeneralRe: String formatting Pin
John Burton8-Jan-03 4:26
John Burton8-Jan-03 4:26 
GeneralRe: String formatting Pin
leppie8-Jan-03 6:12
leppie8-Jan-03 6:12 
GeneralHICON's .NET Equivilent Pin
Nnamdi Onyeyiri7-Jan-03 6:29
Nnamdi Onyeyiri7-Jan-03 6:29 
GeneralRe: HICON's .NET Equivilent Pin
leppie7-Jan-03 7:49
leppie7-Jan-03 7:49 
Generala tree copying Pin
misiek7-Jan-03 6:06
misiek7-Jan-03 6:06 
GeneralRe: a tree copying Pin
leppie7-Jan-03 8:30
leppie7-Jan-03 8:30 
GeneralRe: a tree copying Pin
misiek7-Jan-03 22:33
misiek7-Jan-03 22:33 
GeneralRich Text Box Edit Cursor Pin
KenBloke7-Jan-03 5:35
KenBloke7-Jan-03 5:35 
GeneralRegistering an ActiveX DLL or OCX Pin
mikasa7-Jan-03 5:12
mikasa7-Jan-03 5:12 
GeneralRe: Registering an ActiveX DLL or OCX Pin
Richard Deeming8-Jan-03 2:40
mveRichard Deeming8-Jan-03 2:40 
GeneralRe: Registering an ActiveX DLL or OCX Pin
mikasa8-Jan-03 2:52
mikasa8-Jan-03 2:52 
GeneralRe: Registering an ActiveX DLL or OCX Pin
Richard Deeming8-Jan-03 3:12
mveRichard Deeming8-Jan-03 3:12 
GeneralRe: Registering an ActiveX DLL or OCX Pin
mikasa8-Jan-03 3:43
mikasa8-Jan-03 3:43 
GeneralRe: Registering an ActiveX DLL or OCX Pin
Stephane Rodriguez.8-Jan-03 3:14
Stephane Rodriguez.8-Jan-03 3:14 
GeneralRe: Registering an ActiveX DLL or OCX Pin
mikasa8-Jan-03 3:20
mikasa8-Jan-03 3:20 
GeneralRe: Registering an ActiveX DLL or OCX Pin
mikasa8-Jan-03 4:11
mikasa8-Jan-03 4:11 
GeneralActive Directory - Change and Adding users Pin
Mauricio Ritter7-Jan-03 1:12
Mauricio Ritter7-Jan-03 1:12 
GeneralRe: Active Directory - Change and Adding users Pin
Mazdak8-Jan-03 7:20
Mazdak8-Jan-03 7:20 
These lines are from Professional C# by Wrox press.I suggest you to download sample codes from www.wrox.com,There are two application in that source code that have all examples about Active Directory and C#.

Add user:
using (DirectoryEntry de = new DirectoryEntry())
{            
de.Path = "LDAP://celticrain/OU=Wrox Press, DC=eichkogelstrasse, DC=local";
DirectoryEntries users = de.Children;

DirectoryEntry user = users.Add("CN=John Doe", "user");
user.Properties["company"].Add("Some Company");
user.Properties["department"].Add("Sales");
user.Properties["employeeID"].Add("4711");
user.Properties["samAccountName"].Add("JDoe");
user.Properties["userPrincipalName"].Add("JDoe@eichkogelstrasse.local");
user.Properties["sn"].Add("Doe");
user.Properties["givenName"].Add("John");
user.Properties["userPassword"].Add("someSecret");
user.CommitChanges();
}

Change properties(password):
using (DirectoryEntry de = new DirectoryEntry())
{
de.Path = "LDAP://celticrain/CN=John Doe, CN=Users, DC=eichkogelstrasse, DC=local";
de.Invoke("SetPassword", "anotherSecret");
de.CommitChanges();
ActiveDs.IADsUser user = (ActiveDs.IADsUser)de.NativeObject;
user.SetPassword("someSecret");
user.AccountDisabled = false;
de.CommitChanges();
}


Mazy

"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me
-Tom Waits

GeneralRe: Active Directory - Change and Adding users Pin
Mauricio Ritter8-Jan-03 7:21
Mauricio Ritter8-Jan-03 7:21 
QuestionHow can build an exe file by VS .NET to execute it on Windows_98? Pin
Behzad Ebrahimi7-Jan-03 0:15
Behzad Ebrahimi7-Jan-03 0:15 
AnswerRe: How can build an exe file by VS .NET to execute it on Windows_98? Pin
Heath Stewart7-Jan-03 3:25
protectorHeath Stewart7-Jan-03 3:25 
GeneralComboBox & Dataset with huge data Pin
jpeg6-Jan-03 23:19
jpeg6-Jan-03 23:19 
GeneralRegister a C# dll in Excel Pin
Donald Blachly6-Jan-03 19:41
Donald Blachly6-Jan-03 19:41 
GeneralObfuscation (or "what MS forgot") Pin
Bog6-Jan-03 19:15
Bog6-Jan-03 19:15 
GeneralRe: Obfuscation (or "what MS forgot") Pin
Wesner Moise6-Jan-03 19:27
Wesner Moise6-Jan-03 19:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.