Sometime you may want to uniquely identify a Windows Phone, such as when you are implementing push notifications. The best way to identify a unique Windows Phone is through its device GUID.
 
The following code snippet shows how to obtain the GUID of a Windows Phone device:
 
using Microsoft.Phone.Info;
 
    public static byte[] DeviceId()
    {
        object uniqueId;
        if (DeviceExtendedProperties.TryGetValue(
        "DeviceUniqueId", out uniqueId))
        {
            return (byte[])uniqueId;
        }
        return null;
    }
    ...
    ...
 
    byte[] guid = DeviceId();           
    MessageBox.Show("Device GUID - " +
        Convert.ToBase64String(guid));

For the code above to work, you need to check the ID_CAP_IDENTITY_DEVICE setting in your WMAppManifest.xml file.

Getting the Device GUID的更多相关文章

  1. DriverStudio 和 WDF驱动 通过GUID获取设备句柄的差别

    DriverStudio /***************************************************************************** * 功能: 通过 ...

  2. Beaglebone Black– 智能家居控制系统 LAS - 网页服务器 Node.js 、Web Service、页面 和 TCP 请求转 UDP 发送

    上一篇,纯粹玩 ESP8266,写入了 init.lua 能收发 UDP.这次拿 BBB 开刀,用 BBB host 一个 web server ,用于与用户交互,数据来自 ESP8266 的 UDP ...

  3. guestfs-python 手册

    Help on module guestfs: NAME guestfs - Python bindings for libguestfs FILE /usr/lib64/python2.7/site ...

  4. Linux和Windows设备驱动架构比较

    毕业后一直在学操作系统, 有时候觉得什么都懂了,有时候又觉得好像什么都不懂,但总体来说自认为对操作系统实现机制的了解比周围的人还是要多一些.去年曾花了几个星期的晚上时间断断续续翻译了这篇对Linux和 ...

  5. Direct3D设备管理器(Direct3D device manager)

    这几天在做dxva2硬件加速,找不到什么资料,翻译了一下微软的两篇相关文档.并准备记录一下用ffmpeg实现dxva2,将在第三篇写到.这是第一篇,英文原址:https://msdn.microsof ...

  6. USB编程研究之二(常见设备类型的GUID)

    在USB编程之前要事先了解一下GUID的概念. 应用其他网页中的定义: 全球唯一标识符 (GUID) 是一个字母数字标识符,用于指示产品的唯一性安装.在许多流行软件应用程序(例如 Web 浏览器和媒体 ...

  7. What is a Windows USB device path and how is it formatted?

    http://community.silabs.com/t5/Interface-Knowledge-Base/Windows-USB-Device-Path/ta-p/114059 Windows ...

  8. USB Device Finder

    http://www.velleman.eu/images/tmp/usbfind.c #ifdef __cplusplus extern "C" { #endif #includ ...

  9. usb mass storage device

    Problem adding USB host device to KVM Windows guest machine. Status: CLOSED CURRENTRELEASE   Aliases ...

随机推荐

  1. Activity生命周期 onCreate onResume onStop onPause (转)

    Android应用开发提高系列(6)——Activity生命周期 onCreate 和 onResume 在程序启动时候都会启动, 所有有些需要在onCreate onResume中都要实现的功能,之 ...

  2. wpf window set window的owner

        [DllImport("user32.dll")]   public static extern IntPtr GetAncestor(IntPtr hWnd, int f ...

  3. Java学习笔记(三)——运算符

    一.运算符: 1.分类: 2.java中的运算符 (1)其中,++在左,表示先加了再用,++在右,表示先用了再加. (2)% 用来求余数,也称为"取模运算符" 3.赋值运算符 4. ...

  4. 【SSM】拦截器的原理、实现

    一.背景: 走过了双11,我们又迎来了黑色星期五,刚过了黑五,双12又将到来.不管剁手的没有剁手的,估计这次都要剁手了!虽然作为程序猿的我,没有钱但是我们长眼睛了,我们关注到的是我们天猫.淘宝.支付宝 ...

  5. Android 弹出对话框Dialog充满屏幕宽度

    final View view = LayoutInflater.from(context).inflate(layoutId, null); final Dialog dialog = new Di ...

  6. hdu 1003 MAX SUM 简单的dp,测试样例之间输出空行

    测试样例之间输出空行,if(t>0) cout<<endl; 这样出最后一组测试样例之外,其它么每组测试样例之后都会输出一个空行. dp[i]表示以a[i]结尾的最大值,则:dp[i ...

  7. JavaScript内置对象(字符串,数组,日期的处理)

    Date 日期对象 日期对象可以储存任意一个日期,并且可以精确到毫秒数(1/1000 秒). 定义一个时间对象 : var Udate=new Date(); 注意:使用关键字new,Date()的首 ...

  8. json数据实际应用

    JSON序列化输出 var xiaoming = { name: '小明', age: 14, gender: true, height: 1.65, grade: null, 'middle-sch ...

  9. LA6886 Golf Bot(FFT)

    题目 Source https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page= ...

  10. 每天一个linux命令---kill

    linux中终止进程的命令--kill 一般用的是: 搜索pid: ps -ef|grep calendar 杀死pid:kill -9 pid 格式是:kill[参数][进程号]