Click here to Skip to main content
15,888,033 members
Home / Discussions / C#
   

C#

 
Questionworking with dates and database Pin
elidotnet10-Jul-09 12:00
elidotnet10-Jul-09 12:00 
AnswerRe: working with dates and database Pin
Not Active10-Jul-09 13:18
mentorNot Active10-Jul-09 13:18 
AnswerRe: working with dates and database Pin
Henry Minute10-Jul-09 13:23
Henry Minute10-Jul-09 13:23 
QuestionDifferentiate Restart vs Shut Down, StandBy vs Hibernate Pin
olograph10-Jul-09 11:57
olograph10-Jul-09 11:57 
AnswerRe: Differentiate Restart vs Shut Down, StandBy vs Hibernate Pin
OriginalGriff10-Jul-09 21:57
mveOriginalGriff10-Jul-09 21:57 
QuestionNeed suggestions on datagrid/dataview Pin
babbelfisken10-Jul-09 11:26
babbelfisken10-Jul-09 11:26 
AnswerRe: Need suggestions on datagrid/dataview Pin
DaveyM6910-Jul-09 11:33
professionalDaveyM6910-Jul-09 11:33 
QuestionActive Directory... C#... How do I get the users windows login? Help please. [modified] Pin
JollyMansArt10-Jul-09 10:12
JollyMansArt10-Jul-09 10:12 
Ok now I got the User Names now I am needing help on learning how to filter the list so that I get all persons and not the junk loging such as DHCP Administrator, DNSUpdateProxy groups, etc...
I only want persons...


<code> public void ShowDomainUsers()
{
string filter = "";
//DirectoryEntry domain = new DirectoryEntry("LDAP://domain.com/CN=Users,DC=Domain,DC=com");
try
{
if (File.Exists(Environment.CurrentDirectory + "\\Debug.txt"))
{
MessageBox.Show("LDAP://" + cboDomains.Text + "/CN=Users,DC=" + Left(cboDomains.Text, (cboDomains.Text.IndexOf(".", 0))) + ",DC=" + Right(cboDomains.Text, (cboDomains.Text.Length - cboDomains.Text.IndexOf(".", 0) - 1)));
}
using (DirectoryEntry domain = new DirectoryEntry("LDAP://" + cboDomains.Text + "/CN=Users,DC=" + Left(cboDomains.Text, (cboDomains.Text.IndexOf(".", 0))) + ",DC=" + Right(cboDomains.Text, (cboDomains.Text.Length - cboDomains.Text.IndexOf(".", 0) - 1))))
//root and filter and propertiestoload I do not know what to put
//filter = "(objectCategory=person)(objectClass=user)";
//using (DirectorySearcher searcher = new DirectorySearcher(root,filter,propertiestoload))
//using (SearchResultCollection results = searcher.FindAll())

//sAMAccountName -- THIS IS WHAT I want to get the USER Login names

foreach (DirectoryEntry child in domain.Children)
{
//Console.WriteLine(child.Name);

//lbxDomainUsers.Items.Add(new ListViewItem(new string[] {Right(child.Name, (child.Name.Length - 3)), child.Username}));

lbxDomainUsers.Items.Add(Right(child.Name, (child.Name.Length - 3)) + " | " + child.Properties["sAMAccountName"].Value);// Username);
}
}
catch
{
MessageBox.Show("We are having a problem with the active directory.");
}
}

modified on Friday, July 10, 2009 5:37 PM

QuestionRe: Active Directory... C#... How do I get the users windows login? Help please. Pin
JollyMansArt10-Jul-09 12:13
JollyMansArt10-Jul-09 12:13 
AnswerFigured it out... Pin
JollyMansArt10-Jul-09 12:18
JollyMansArt10-Jul-09 12:18 
Questiontabbed forms with identical content. Pin
avDallas10-Jul-09 9:18
avDallas10-Jul-09 9:18 
AnswerRe: tabbed forms with identical content. Pin
DaveyM6910-Jul-09 11:18
professionalDaveyM6910-Jul-09 11:18 
GeneralRe: tabbed forms with identical content. Pin
avDallas10-Jul-09 18:05
avDallas10-Jul-09 18:05 
AnswerRe: tabbed forms with identical content. Pin
Henry Minute10-Jul-09 11:24
Henry Minute10-Jul-09 11:24 
QuestionDifference between Methods and Functions? Pin
Rajdeep.NET10-Jul-09 8:46
Rajdeep.NET10-Jul-09 8:46 
AnswerRe: Difference between Methods and Functions? Pin
Blue_Boy10-Jul-09 8:50
Blue_Boy10-Jul-09 8:50 
AnswerRe: Difference between Methods and Functions? Pin
0x3c010-Jul-09 9:03
0x3c010-Jul-09 9:03 
GeneralRe: Difference between Methods and Functions? Pin
Rajdeep.NET10-Jul-09 9:19
Rajdeep.NET10-Jul-09 9:19 
GeneralRe: Difference between Methods and Functions? Pin
0x3c010-Jul-09 9:43
0x3c010-Jul-09 9:43 
GeneralRe: Difference between Methods and Functions? Pin
PIEBALDconsult10-Jul-09 13:44
mvePIEBALDconsult10-Jul-09 13:44 
AnswerRe: Difference between Methods and Functions? Pin
PIEBALDconsult10-Jul-09 9:19
mvePIEBALDconsult10-Jul-09 9:19 
GeneralRe: Difference between Methods and Functions? Pin
harold aptroot10-Jul-09 10:04
harold aptroot10-Jul-09 10:04 
GeneralRe: Difference between Methods and Functions? Pin
DaveyM6910-Jul-09 11:26
professionalDaveyM6910-Jul-09 11:26 
GeneralRe: Difference between Methods and Functions? Pin
PIEBALDconsult10-Jul-09 13:49
mvePIEBALDconsult10-Jul-09 13:49 
GeneralRe: Difference between Methods and Functions? Pin
harold aptroot10-Jul-09 14:12
harold aptroot10-Jul-09 14:12 

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.