Solved

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

Posted on 2013-01-07
2
1,054 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 500 total points
Comment Utility
0
 

Author Closing Comment

by:axnst2
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now