GET COMPUTER NAME



public List GetComputersOnNetwork()
{
    List list = new List();
    using (DirectoryEntry root = new DirectoryEntry("WinNT:"))
    {
        foreach (DirectoryEntry computers in root.Children)
        {
            foreach (DirectoryEntry computer in computers.Children)
            {
                if ((computer.Name != "Schema"))
                {
                    list.Add(computer.Name);
                    comboBox1.Items.Add(computer.Name );
                }
            }
        }
    }
    return list;
}

No comments: