微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c# – 我不能得到我的ANID?

我已经添加到WMAppManifest.xml中:

>< Capability Name =“ID_CAP_IDENTITY_DEVICE”/>
>< Capability Name =“ID_CAP_IDENTITY_USER”/>

那么为什么要继续获得空字符串:

public static string GetwindowsLiveAnonymousID()
        {
            int ANIDLength = 32;
            int ANIDOffset = 2;

            string result = string.Empty;
            object anid;
            if (UserExtendedProperties.TryGetValue("ANID",out anid))
            {
                if (anid != null && anid.ToString().Length >= (ANIDLength + ANIDOffset))
                {
                    result = anid.ToString().Substring(ANIDOffset,ANIDLength);
                }
            }

            return result;
        }

它似乎没有处理TryGetValue非常好…有人得到一个线索?

解决方法

It’s called ANID2 in Windows Phone 8.

The UserExtendedProperties API exposes two properties: ANID and ANID2.

  • ANID can only be accessed from Windows Phone OS 7.0 and Windows Phone OS 7.1 apps that use the Microsoft Advertising SDK for Windows Phone.

  • ANID2 can only be accessed from Windows Phone 8 apps.

原文地址:https://www.jb51.cc/csharp/93963.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐