简体   繁体   English

如何访问Windows Phone 7中的联系人列表?

[英]How to access contacts list in Windows Phone 7?

How do you access the contacts store (the contact list) within Windows Phone 7? 您如何在Windows Phone 7中访问联系人存储(联系人列表)?

Thanks! 谢谢!

update : It seems that this might be available in the next version of WP7, Mango: 更新 :看来这可能在WP7的下一版本Mango中可用:

http://blogs.msdn.com/b/johnalioto/archive/2011/04/13/10153420.aspx http://blogs.msdn.com/b/johnalioto/archive/2011/04/13/10153420.aspx

EDIT: This answer was correct at the time of posting. 编辑:这个答案在发布时是正确的。 In Windows Phone 7.1 (Mango) third-party applications will have access to contacts. 在Windows Phone 7.1(Mango)中,第三方应用程序将有权访问联系人。


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 or PhoneNumberChooserTask to get back just that piece of information about a user-specified contact. 编辑:尽管您不能直接访问联系人列表,但是您可以启动EmailAddressChooserTaskPhoneNumberChooserTask来仅获取有关用户指定联系人的那条信息。 (Likewise you can launch a task to save a phone number or email address.) (同样,您可以启动任务来保存电话号码或电子邮件地址。)

There is a official Walkthrough at Microsoft especially for Mango Beta 2. Microsoft上有一个官方演练,特别是Mango Beta 2。

Windows Phone SDK 7.1 Beta 2 gives you read-only access to the user's contact data, aggregated across the user's different accounts. Windows Phone SDK 7.1 Beta 2使您可以只读访问用户的联系数据,这些数据跨用户的不同帐户进行汇总。

Only possible way to save new details to a contact is via the Launchers: 将新的详细信息保存到联系人的唯一可能方法是通过启动器:

  • SaveEmailAddressTask SaveEmailAddressTask
  • SavePhoneNumberTask SavePhoneNumberTask
  • SaveContactTask (which is new to Mango Beta 2) SaveContactTask(这是Mango Beta 2的新增功能)

For read only you can use: 对于只读的,您可以使用:

  • PhoneNumberChooserTask PhoneNumberChooserTask
  • EmailAddressChooserTask EmailAddressChooserTask
  • AddressChooserTask (which is new to Mango Beta 1) AddressChooserTask(这是Mango Beta 1的新增功能)

If you want to query the whole contact list, you will need LINQ. 如果要查询整个联系人列表,则需要LINQ。

Check the WP7.1 SDK Beta for the class "Contacts" listed in the namespace UserData . 检查WP7.1 SDK Beta中命名空间UserData中列出的类“ Contacts”。 Now you should be able to... 现在您应该能够...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM