显示联系人列表 [英] Display Contact list

查看:116
本文介绍了显示联系人列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


private void ButtonContacts_Click( object 发件人,
RoutedEventArgs e)

privatevoidButtonContacts_Click(objectsender, RoutedEventArgse)

        {

        {

           

           

联系人 cons =
new 联系人 ();

Contactscons = newContacts();

           

           

//识别异步搜索后运行的方法完成。

            cons.SearchCompleted + =

            cons.SearchCompleted +=

new EventHandler < ContactsSearchEventArgs >(Contacts_SearchCompleted);

newEventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted);

          &NBSP;&NBSP;

           

//启动异步搜索。

            cons.SearchAsync(

            cons.SearchAsync(

String 。空,
FilterKind 。无,
" ;所有联系人" );

String.Empty, FilterKind.None, "All Contacts");

       ;&NBSP; }

        }

       

       

void Contacts_SearchCompleted( 对象 发件人,
ContactsSearchEventArgs e)

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆