Avatar of axnst2
axnst2Flag for United States of America

asked on 

Retreive device's IP Address, Mac Address, and host name under Compact Framework 2.0

Hi Experts,

  The title sais it all!  I need to retreive the local device's IP Address, Mac Address, and host name under Compact Framework 2.0!  Any help would be greatly appreciated!

Thanks!
.NET Programming

Avatar of undefined
Last Comment
axnst2
ASKER CERTIFIED SOLUTION
Avatar of ashokpumca
ashokpumca
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of axnst2
axnst2
Flag of United States of America image

ASKER

Thanks!  I figured out how the host name and IP address:

using System.Net;

            IPHostEntry host;
            string localIP = "?";
            host = Dns.GetHostEntry(Dns.GetHostName());

            foreach (IPAddress ip in host.AddressList)
            {
                if (ip.AddressFamily.ToString() == "InterNetwork")
                {
                    localIP = ip.ToString();
                }

                MessageBox.Show(localIP);
            }

The solution you provided for Mac address doesn't work under the compact framework but fortunately my reqiurements have changed and I no longer need to be able to retreive it!

Thanks for your help!
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo