Click here to Skip to main content
16,021,041 members
Home / Discussions / C#
   

C#

 
AnswerRe: 2 Question about using XML in C# Pin
Christian Graus27-Aug-07 20:07
protectorChristian Graus27-Aug-07 20:07 
Questionvideo capturing and sms feature Pin
4Hamburger27-Aug-07 15:49
4Hamburger27-Aug-07 15:49 
Questioncombobox.datasource question Pin
udikantz27-Aug-07 15:27
udikantz27-Aug-07 15:27 
AnswerRe: combobox.datasource question Pin
mihirhp27-Aug-07 20:28
mihirhp27-Aug-07 20:28 
GeneralRe: combobox.datasource question Pin
udikantz27-Aug-07 21:18
udikantz27-Aug-07 21:18 
GeneralRe: combobox.datasource question Pin
mihirhp27-Aug-07 22:24
mihirhp27-Aug-07 22:24 
QuestionActive Directory Pin
T4AMD27-Aug-07 14:08
T4AMD27-Aug-07 14:08 
AnswerRe: Active Directory Pin
ekynox27-Aug-07 15:52
ekynox27-Aug-07 15:52 
If you want to interrogate Active Directory through the .NET framework then you can use either System.DirectoryServices or the System.Management namespaces. System.Management uses WMI to query AD. For either technique you need to supply a username and password to gain access to AD with and to perform queries.

You might need to store the username and password of a user who has enough previleages to access and update Active Directory in an encrypted format in some configuration file.

To give an example of using System.DirectoryServices here is a sample code which determines which users are part of the Domain Admins group.
DirectoryEntry de= new DirectoryEntry();
de.Path = "LDAP://clown.acme.com"; //clown is the server name hosting the domain controller & acme.com is the domain name.
de.Username = "administrator";
de.Password = "passw$rd";
de.AuthenticationType = AuthenticationTypes.Secure

//now lets search for a user using the above credentials
try
{
DirectorySearcher searcher = new DirectorySearcher();
searcher .SearchRoot = de;
searcher .Filter = "(cn=" + "Domin Admins" + ")";
SearchResultCollection results = searcher .FindAll();
Console.Writeline(results.Count.ToString())
}
catch (Exception exception)
{
Console.Writeline(exception.Message);
}

Further refer to this MSDN reference for more information:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sds/sds/quick_list_for_c__code_examples.asp[^]

Just a warning Active Directory can be a pain at times.
Questionnull exception while passing a serial port instance to an object Pin
murr00727-Aug-07 13:21
murr00727-Aug-07 13:21 
AnswerRe: null exception while passing a serial port instance to an object Pin
Luc Pattyn27-Aug-07 14:41
sitebuilderLuc Pattyn27-Aug-07 14:41 
GeneralRe: null exception while passing a serial port instance to an object Pin
murr00727-Aug-07 15:56
murr00727-Aug-07 15:56 
GeneralRe: null exception while passing a serial port instance to an object Pin
Luc Pattyn27-Aug-07 17:02
sitebuilderLuc Pattyn27-Aug-07 17:02 
QuestionHow can I prohibit writing a characters? Pin
daavena27-Aug-07 10:51
daavena27-Aug-07 10:51 
AnswerRe: How can I prohibit writing a characters? Pin
Pete O'Hanlon27-Aug-07 11:18
mvePete O'Hanlon27-Aug-07 11:18 
GeneralRe: How can I prohibit writing a characters? Pin
daavena27-Aug-07 11:35
daavena27-Aug-07 11:35 
GeneralRe: How can I prohibit writing a characters? Pin
Yitzchok Dev27-Aug-07 12:56
Yitzchok Dev27-Aug-07 12:56 
GeneralRe: How can I prohibit writing a characters? Pin
daavena28-Aug-07 10:28
daavena28-Aug-07 10:28 
QuestionUTF-8 characters in RichTextBox with SelectedRtf... Pin
Paradox2227-Aug-07 10:00
Paradox2227-Aug-07 10:00 
QuestionIUPnPDeviceFinder Pin
MicealG27-Aug-07 9:53
MicealG27-Aug-07 9:53 
AnswerRe: IUPnPDeviceFinder Pin
Mark Churchill27-Aug-07 15:34
Mark Churchill27-Aug-07 15:34 
GeneralRe: IUPnPDeviceFinder Pin
MicealG28-Aug-07 5:38
MicealG28-Aug-07 5:38 
QuestionAdvanced Typed Dataset Pin
hamid_m27-Aug-07 9:42
hamid_m27-Aug-07 9:42 
QuestionSerial Keys. Make trial version. Examples ? Pin
finayev27-Aug-07 9:40
finayev27-Aug-07 9:40 
AnswerRe: Serial Keys. Make trial version. Examples ? Pin
Spacix One27-Aug-07 10:14
Spacix One27-Aug-07 10:14 
QuestionAdding "%" at the end of text in a textbox Pin
basi001427-Aug-07 9:22
basi001427-Aug-07 9:22 

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.