我也可以收到电子邮件和显示名称,但我找不到任何属性来获取我所选择的电话号码,我的代码在下面
var contactPicker = new Windows.ApplicationModel.Contacts.ContactPicker();
contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.PhoneNumber);
联系contact = await contactPicker.PickContactAsync();
if (contact != null)
{
}
答案 0 :(得分:0)
string phoneNumber = string.Empty;
var contactPicker = new Windows.ApplicationModel.Contacts.ContactPicker();
contactPicker.DesiredFieldsWithContactFieldType.Add(ContactFieldType.PhoneNumber);
Contact contact = await contactPicker.PickContactAsync();
if (contact != null)
{
foreach (ContactPhone phone in contact.Phones as IList<ContactPhone>)
{
phoneNumber = phone.Number;
}
}