c# - Get IPAddresses on a local Network using `Directory Entry` -


i have develop desktop app shall allow me file sharing on local network.for this, able listview of devices hostname when comes know ip addresses , mac went see system.netand several other msdn forums (where available metro apps).

how can ip addresses & mac address of devices on local network?

i using directoryentry user names , displayed in listview.

   lstlocal.items.clear();         lstlocal.view = view.details;         lstlocal.fullrowselect = true;          directoryentry root = new directoryentry("winnt:");          foreach (directoryentry computers in root.children)         {             foreach (directoryentry computer in computers.children)             {                 if (computer.name != "schema")                 {                     listviewitem item = new listviewitem(computer.name);                    // item.subitems.add(computer.name);                      //messagebox.show(computer.name);                     lstlocal.items.add(item);                  }              }         } 

update: used

                     var hostname = dns.gethostname();                     var ipadd = dns.gethostaddresses(hostname); 

but address in ipv6 returned.i need in ipv4.

if have host names, done.

you can


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -