title: Get list of all computers on a network in C#
body: <p>I need to get a list of all the computers on the network (Lan). </p>
  
  <p>I tried method using Active Directory, Below is Code:</p>
  
  <pre><code>   DirectoryEntry root = new DirectoryEntry("WinNT:");
     foreach (DirectoryEntry computers in root.Children)
     {
         foreach (DirectoryEntry computer in computers.Children)
          {
             if (computer.Name != "Schema")
              {
                 cb.Items.Add(computer.Name);
              }
          }
    }
  </code></pre>
  
  <p>But this Doesn't list all the computers on network, as displayed in windows  explorer (under Network). How The Windows Network Explorer gets the list of computer if NetworkDiscovery is Disabled in those Computers. 
  I am not supposed to use "net view" or any other commands. </p>
  
  <p>Please Help. </p>