gpt4 book ai didi

c# - ANID 和 ANID2 长度不是 API 所说的 32

转载 作者:太空宇宙 更新时间:2023-11-03 10:53:05 25 4
gpt4 key购买 nike

阅读 UserExtendedProperties.TryGetValue(string propertyName, out Object propertyValue) 的文档后

文档说:

The string returned by the ANID and ANID2 properties contains the anonymous identifier and is 32 characters long.

但是当我在我的设备(WP8)上测试 ANID2 时,返回的字符串长度是 44。

经过一些搜索,我找到了这个 article其中包括提取 ANID 的方法:

  private const int ANIDLength = 32;
private const int ANIDOffset = 2;

public static string GetWindowsLiveAnonymousID()
{
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;
}

我的问题:这是提取 ANID 和 ANID2 的正确方法吗?为什么返回的字符串长度不是 API 所说的从一开始就是 32?

我问这个问题的原因是另一个 question here与此主题相关,答案是从上述方法的检查中减去 1。哪一个是正确的,为什么?

谢谢

最佳答案

ANID2 绑定(bind)到 Windows Live Account IdPublisher GUID。因此,来自不同发布者的应用程序将获得不同的 ANID2 值

此链接深入了解更多细节- ANID2

摘录:

以下内容也适用于 Windows Phone 8。

WP7 中的格式类似于(我删除了一些字符):A=E32ACBXXXXXXXXX3B337B68CFFFFFFFF&E=d59&W=1

在 WP7 中,有必要解析 A= 到 &E= 之后的值,因为其他值可能会随时间变化。

关于c# - ANID 和 ANID2 长度不是 API 所说的 32,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20612382/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com