.NET CF: Get MAC address of Pocket PC

Posted on 2004-10-30
Last Modified: 2013-11-18
I need a simple C# function that returns a string representing the MAC address of the Pocket PC's WiFi network adapter. Thanks in advance for your help.
Question by:drj5y
    LVL 48

    Accepted Solution

    LVL 7

    Assisted Solution

    "You will have to P/Invoke the GetAdaptersInfo() API call in iphlpapi.dll.

    Check out Mr Feinman's sample:"

    Assisted Solution

    OpenCF is a free-to-use library for .NET look here:
    You need to create a and call the adapter.MacAddress.

    I used this myself to get the associeted accesspoint, the MAC address and the current signalstrength of the wifi-card connection on a PocketPC.

    a code example (in VB.NET CF but it is almost the same in C#):
    Imports System
    Imports OpenNETCF
    Imports OpenNETCF.Net

    'Declare the Networking instance
    Dim Networkinstance As OpenNETCF.Net.Networking
    'Declare a instance of an networkadapter
    Dim MyAdapter As OpenNETCF.Net.Adapter
    'Declare the collection of installed networkadapters
    Dim MyAdapters As OpenNETCF.Net.AdapterCollection

    'load adapter collection with adapter items
    MyAdapters = Networkinstance.GetAdapters

    'Declare a bitconverter class to convert the MAC addres in
    'a human readable form
    Dim bc As BitConverter
    dim x as int32
    'iterate through the dedected adapters
    For x = 0 To (MyAdapters.Count - 1)

    MyAdapter = MyAdapters.Item(x)
    'display some information about the adapters found
    msgBox("name: " & MyAdapter.Name.ToString)

    msgBox("MAC Address: " & bc.ToString(MyAdapter.MacAddress)

    msgBox("IP: "  & MyAdapter.CurrentIpAddress.ToString)

    If MyAdapter.IsWireless Then msgBox("accessPoint:" & MyAdapter.AssociatedAccessPoint.ToString)
    If MyAdapter.IsWireless Then msgBox("Type:" & MyAdapter.SignalStrength.ToString)

    Next x


    Good Luck !


    Expert Comment

    And here is the direct link for downloading openNetCF:


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    IT Security CISA, CISSP & CISM Certification

    Master the advanced techniques required to protect network resources from external threats with the IT Cyber Security bundle. Built around industry best-practice guidelines, the IT Cyber Security bundle consists of three in-depth courses.

    Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator ( This article presumes a wor…
    Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    875 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

    15 Experts available now in Live!

    Get 1:1 Help Now