?
Solved

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

Posted on 2013-01-07
2
Medium Priority
?
1,218 Views
Last Modified: 2013-01-08
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!
0
Comment
Question by:axnst2
2 Comments
 
LVL 5

Accepted Solution

by:
ashokpumca earned 1500 total points
ID: 38753675
0
 

Author Closing Comment

by:axnst2
ID: 38754936
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!
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question