Bharti,
Does it work for you to use the System.Net.DNS class?
using System;
using System.Net;
...
IPHostEntry ipEntry = Dns.GetHostByName(Dns.GetHostName());
IPAddress[] ipAddress = ipEntry.AddressList;
for(int ip = 0; ip < ipAddress.Length; ip++)
{
Console.WriteLine("IP Address {0} is {1}", ip, ipAddress[ip].ToString());
}
Hope this helps. It doesn't use MAC address but instead starts by getting current host
name and then generating IPEntry data from that.
Mike Diehl
Extreme Logic
-----Original Message-----
From: Bharti Batra [mailto:[EMAIL PROTECTED]
Sent: Thu 6/26/2003 6:18 AM
To: [EMAIL PROTECTED]
Cc:
Subject: [ADVANCED-DOTNET] IP Address associated with MAC
Hi,
Using the ManagementClass of .NET I can retrieve the MAC Address of the
NICs available on the local machine. Using this MAC, how can I know the
corresponding IP Address assigned to this NIC? I have tried using the
Management Class with string name "IPAddress", but it fails.
Any clues?
Thanx & Regds,
Bharti