Martin,
You might be able to get the host name through the static GetHostEntry
method on the Dns class, but I don't know that it will give you the NETBIOS
name (which is what I think you are after).
As for getting the mac address, you will have to connect to the WMI
provider on the host machine and then query for the Win32_NetworkAdapter
instance that corresponds to the IP address (which you will have to join in
the WMI query with the appropriate Win32_NetworkAdapterConfiguration
instance) to get the mac address.
How were you doing it in Delphi? If you were using Windows APIs, then
you might find it easier to just translate the calls into .NET.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"martin lanny" <tr********@gmail.comwrote in message
news:cd******************************@giganews.com ...
Simple network scanner is a part of my dotnet solution. It pings ip
addresses in a selected network range and gives me the response time for
each computer it finds.
Anyhow, I would need to retrieve two more pieces of information for each
active (local network) IP address:
- Computer's Host Name
- Mac Address
Can someone give me an example of how to do so?
I've have this working in Delphi, but I need to port this functionality
into my dotnet version of the program.
Thank you for your time, your help is really appreciated.
Martin