简体   繁体   中英

How to get mac address or serial number of windows phone 8.1 using c#

I am developing windows phone application in 8.1 . How do I get mac address or serial number of device.

You can use the ASHWID to get device ID, but it is package related ID. If you need device ID which is not related to app package use the AdvertisingID but it's require more permissions.

Sample code to get ASHWID:

var token = HardwareIdentification.GetPackageSpecificToken(null);
var hardwareId = token.Id;
var base64Hwid = Convert.ToBase64String(hardwareId.ToArray());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM