[英]How to get the ID of the contact on Windows Phone contact list?
I want to get ID of Contact List Application... Currently I am using class named PhoneNumberChooserTask
like Chooser Class but I get only Number, Name, FullName. 我想获取联系人列表应用程序的ID ...目前我正在使用名为PhoneNumberChooserTask
类,如Chooser Class,但我只得到Number,Name,FullName。 etc.. but how to get ID of that contact? 等..但如何获得该联系人的ID?
Yes It is possible, 对的,这是可能的,
Contact c = new Contact();
var Id = c.GetHashCode(); //gives the Id property value.
You have nothing to use the ID for, so it's simply not available to you as a developer. 您没有任何可以使用该ID的内容,因此您作为开发人员无法使用它。 (That means it's not possible .) (这意味着它不可能 。)
According to this answer GetHashCode returns the private property ID of the contact. 根据此答案, GetHashCode返回联系人的私有属性ID。 I have confirmed that in 3 devices (Lumia 620, Lumia 1320, Lumia 925) running Windows Phone 8.1 and it seems to work. 我已经确认在运行Windows Phone 8.1的3个设备(Lumia 620,Lumia 1320,Lumia 925)中它似乎工作。 I changed contacts details but the ID remained the same. 我更改了联系人详细信息,但ID保持不变。
Uniquely identifying contacts in a Windows Phone Address Book 唯一标识Windows Phone通讯簿中的联系人
For Windows Phone 8.1 RT you can just use the contact Id property . 对于Windows Phone 8.1 RT,您只需使用联系人ID属性即可 。 GetHashCode() is no longer needed. 不再需要GetHashCode()。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.