2011-04-27 47 views
-1

什么是用于访问从地址簿中的联系人,在Windows Mobile应用程序时,该联系人存储到Windows手机地址簿中的代码?访问Windows移动通讯簿

我想:

(Microsoft.WindowsMobile.PocketOutlook.OutlookSession ss = new OutlookSession()) 
{ 
    ContactCollection mobilePhoneBook = ss.Contacts.Items; 
    foreach (Contact aContact in mobilePhoneBook) 
    { 
     MessageBox.Show("First Name: " + aContact.FirstName.ToString() 
      + "\n Mobile Number: " + aContact.MobileTelephoneNumber.ToString()); 
    } 
} 

它给人的错误:

can't find pinvoke dll 'pimstore.dll'

回答

2

Here is an article指定有关如何访问的WinMo

接触

我会总结方法指定

  1. 添加名字空间:使用Microsoft.WindowsMo​​bile.PocketOutlook程序 ;

  2. 添加一个Assembly: Microsoft.WindowsMo​​bile.PocketOutlook程序

  3. 访问触点

    OutlookSession MySession的新= OutlookSession();
    ContactCollection集合= mySession.Contacts.Items;
    foreach(集合中的联系人联系人)
    {
    //使用联系人详细信息写入文件或更新
    }

Here is the namespace,这将是您最有用

+0

所以是工作或不代码? :S – 2011-04-27 07:27:33