简体   繁体   中英

How to save contacts on windows phone using Windows 8.1 API

如何将联系人保存到系统电话簿而不是Windows 8.1运行时API而不是Silver Light 8.1 API的应用程序内电话簿?

You can only get/find contacts from the phone book. I think there is no API to save or create new contact in the phone book. Below is the example how you can get contacts in windows 8.1 universal app.

public async void FindContacts(string searchText)
    {
        ContactStore contactStore = await ContactManager.RequestStoreAsync();

        IReadOnlyList<Contact> contacts = null;

        if (String.IsNullOrEmpty(searchText))
        {
            contacts = await contactStore.FindContactsAsync();
        }
        else
        {
            contacts = await contactStore.FindContactsAsync(searchText);
        }

    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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