2012-01-31 38 views

回答

4

不要使用Windows 7的這個功能它是在Vista中引入並很快在Windows Server 2008中

任何方式,here is the entrance to C++ API section (that also explains the Contacts schema) at MSDN得到了棄用。

但是對於託管代碼,您應該使用Contacts.Net項目here at codeplex。這裏有一個枚舉聯繫人的簡單例子:

//using Microsoft.Communications.Contacts; 

ContactManager theContactManager = new ContactManager(); 
foreach (Contact theContact in theContactManager.GetContactCollection()) 
{ 
    string theLine = theContact.Names[0].FormattedName; 
    foreach(PhoneNumber theNumber in theContact.PhoneNumbers) 
     theLine += "\t" + theNumber.ToString(); 
    listBox1.Items.Add(theLine); 
    //Console.WriteLine(theLine); //Uncomment this if on console 
} 
相關問題