3
我有一個應用程序,我希望我的控件(可能是列表框)填充Windows聯繫人(存在於Windows 7中)中的聯繫人姓名和號碼。這怎麼可能?如何以編程方式從Windows Contacts中檢索所有聯繫人的詳細信息?
我有一個應用程序,我希望我的控件(可能是列表框)填充Windows聯繫人(存在於Windows 7中)中的聯繫人姓名和號碼。這怎麼可能?如何以編程方式從Windows Contacts中檢索所有聯繫人的詳細信息?
不要使用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
}
請不要在你的標題中添加「(C#,.NET)」之類的東西。這就是標籤的用途。 – 2012-02-01 00:07:55