private void button1_Click(object sender, System.EventArgs e)
{
using(DirectoryEntry root = new DirectoryEntry("WinNT://"+ Environment.MachineName))
{
foreach (DirectoryEntry child in root.Children)
{
if (child.SchemaClassName == "User")
{
listBox1.Items.Add(child.Name);
}
}
}
}
private void button2_Click(object sender, System.EventArgs e)
{
using(DirectoryEntry root = new DirectoryEntry("WinNT://"+ Environment.MachineName))
{
foreach (DirectoryEntry child in root.Children)
{
if (child.SchemaClassName == "Group")
{
listBox2.Items.Add(child.Name);
}
}
}
}
Wednesday, August 1, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment