显示联系人列表 [英] Display Contact list
问题描述
private void ButtonContacts_Click( object 发件人, privatevoidButtonContacts_Click(objectsender,
RoutedEventArgse) { { 联系人 cons = Contactscons =
newContacts(); //识别异步搜索后运行的方法完成。 cons.SearchCompleted + = cons.SearchCompleted +=
new EventHandler < ContactsSearchEventArgs >(Contacts_SearchCompleted); newEventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted); &NBSP;&NBSP; //启动异步搜索。 cons.SearchAsync( cons.SearchAsync( String 。空, String.Empty,
FilterKind.None,
"All Contacts");   ;&NBSP; } } void Contacts_SearchCompleted( 对象 发件人, voidContacts_SearchCompleted(objectsender,
ContactsSearchEventArgse) { { //对结果做一些事情。 txtShow.Text = e.Results.Count()。ToString(); txtShow.Text = e.Results.Count().ToString(); } } 上面的代码无法正常工作并给我打击错误 above code is not working and giving me blow error 类型'系统的例外.UnauthorizedAccessException'发生在Microsoft.Phone.ni.dll中但未在用户代码中处理 An exception of type 'System.UnauthorizedAccessException' occurred in Microsoft.Phone.ni.dll but was not handled in user code plz帮助我们 您是否为应用设置了ID_CAP_CONTACTS功能?在VS中,展开项目下的"属性"节点,然后打开WMAppManifest.xml文件。选择功能选项卡,然后选择必要功能。 Have you set the ID_CAP_CONTACTS capability for your app? In VS, Expand the Properties node under your Project and open the WMAppManifest.xml file. Select the Capabilities tab, and select neccesary capabilities. HTH Mikael 这篇关于显示联系人列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
RoutedEventArgs e)
new 联系人 ();
FilterKind 。无,
" ;所有联系人" );
ContactsSearchEventArgs e) 推荐答案