简体   繁体   English

如何使用Windows 8.1 API在Windows Phone上保存联系人

[英]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. 我认为电话簿中没有API可以保存或创建新联系人。 Below is the example how you can get contacts in windows 8.1 universal app. 下面是示例如何在Windows 8.1通用应用程序中获取联系人的示例。

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);
        }

    }

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

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