Monday, 29 April 2013

Get list of network computer names using C#

//get Network Computers Name
// Use using System.Net.NetworkInformation;


using System.Net.NetworkInformation;
NetworkBrowser nb1 = new NetworkBrowser();
string[] PCIP = new string[250];
int i = 0;
foreach (string pc in nb1.getNetworkComputers())
{
    PCIP[i] = pc;
    i++;
}

2 comments:

  1. Error 1 'Invertar.NetworkBrowser' does not contain a definition for 'getNetworkComputers' and no extension method 'getNetworkComputers' accepting a first argument of type 'Invertar.NetworkBrowser' could be found (are you missing a using directive or an assembly reference?) C:\Users\User\Documents\Visual Studio 2013\Projects\Invertar\Invertar\Form1.cs 29 39 Invertar

    selam soyle bir hata aliyorum

    ReplyDelete
  2. He's using code from https://www.codeproject.com/Articles/16113/Retreiving-a-list-of-network-computer-names-using

    ReplyDelete