如何在 Windows Phone 7 中访问联系人列表?
How do you access the contacts store (the contact list) within Windows Phone 7?
Thanks!
update: It seems that this might be available in the next version of WP7, Mango:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
编辑:这个答案在发布时是正确的。在 Windows Phone 7.1 (Mango) 中,第三方应用程序将有权访问联系人。
你不能。你不被允许这样做。这被视为应用程序不应触及的私有数据。
编辑:虽然您无法直接访问联系人列表,但您可以启动
EmailAddressChooserTask
或PhoneNumberChooserTask
获取有关用户的信息 - 指定联系人。 (同样,您可以启动任务来保存电话号码或电子邮件地址。)EDIT: This answer was correct at the time of posting. In Windows Phone 7.1 (Mango) third-party applications will have access to contacts.
You can't. You're not allowed to. That's viewed as private data that applications shouldn't be touching.
EDIT: Although you can't directly access the contacts list, you can launch the
EmailAddressChooserTask
orPhoneNumberChooserTask
to get back just that piece of information about a user-specified contact. (Likewise you can launch a task to save a phone number or email address.)有一个 Microsoft 的官方演练特别是对于 Mango Beta 2。
向联系人保存新详细信息的唯一可能方法是通过启动器:
对于只读,您可以使用:
如果您想要查询整个联系人列表,你将需要LINQ。
There is a official Walkthrough at Microsoft especially for Mango Beta 2.
Only possible way to save new details to a contact is via the Launchers:
For read only you can use:
If you want to query the whole contact list, you will need LINQ.
检查 WP7.1 SDK Beta 中列出的“联系人”类在命名空间 UserData 中。现在你应该能够...
Check the WP7.1 SDK Beta for the class "Contacts" listed in the namespace UserData . Now you should be able to...