2011-04-27 80 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