Pocket PC 2003 SE Emulator
-
Monday, February 27, 2012 10:23 AM
Hi Guys,
I'm currently developing an app for pocket pc 2003 se emulator using visual studio 2008. there is a code that I need in order to get the MAC address of the device. I got a code from the internet, but it only works on windows form, not on the emulator. i wanted to use the same code, but i get the error stating Type 'networkInformation' is not defined. I tried to import the system.net.networkInformation namespace, but it is not available. may you please help?
Thank you in advance. (Selolo)
All Replies
-
Monday, February 27, 2012 4:46 PMModeratorSee if this helps: http://social.msdn.microsoft.com/Search/en-US/?query=get%20MAC%20address&rq=meta:Search.MSForums.GroupID(01328876-91a4-41ba-861c-7cdd44d922f5)+site:microsoft.com&rn=All+Smart+Device+Development+Forums
This posting is provided "AS IS" with no warranties, and confers no rights.
-
Wednesday, February 29, 2012 3:15 AMModerator
Hello,
I think you can use GetAdaptersInfo API to get the MAC address.
http://msdn.microsoft.com/en-us/library/aa916102.aspx
You can follow these codes in C++// Fetches the MAC address and prints it static void GetMACaddress(void) { IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information // for up to 16 NICs DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo AdapterInfo, // [out] buffer to receive data &dwBufLen); // [in] size of receive data buffer assert(dwStatus == ERROR_SUCCESS); // Verify return value is // valid, no buffer overflow PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to // current adapter info do { PrintMACaddress(pAdapterInfo->Address); // Print MAC address pAdapterInfo = pAdapterInfo->Next; // Progress through // linked list } while(pAdapterInfo); // Terminate if last adapter }
Or you can P/Inoke this API in C#.
http://www.pinvoke.net/default.aspx/iphlpapi.getadaptersinfoBest regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- Marked As Answer by Jesse JiangMicrosoft Contingent Staff, Moderator Monday, March 05, 2012 2:19 AM

