How to access contacts list in Windows Phone 7?

2019-01-18 20:02发布

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:

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

3条回答
我命由我不由天
2楼-- · 2019-01-18 20:32

There is a official Walkthrough at Microsoft especially for 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.

Only possible way to save new details to a contact is via the Launchers:

  • SaveEmailAddressTask
  • SavePhoneNumberTask
  • SaveContactTask (which is new to Mango Beta 2)

For read only you can use:

  • PhoneNumberChooserTask
  • EmailAddressChooserTask
  • AddressChooserTask (which is new to Mango Beta 1)

If you want to query the whole contact list, you will need LINQ.

查看更多
放我归山
3楼-- · 2019-01-18 20:32

Check the WP7.1 SDK Beta for the class "Contacts" listed in the namespace UserData . Now you should be able to...

查看更多
Luminary・发光体
4楼-- · 2019-01-18 20:41

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 or PhoneNumberChooserTask 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.)

查看更多
登录 后发表回答