我正在尝试使用以下代码从Outlook(2007)获取联系人:
Outlook.Application outlookApp = new Outlook.Application();
Outlook.MAPIFolder fldContacts = outlookApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts) as Outlook.MAPIFolder;
foreach (Outlook._ContactItem contact in fldContacts.Items) {...}
问题是,当我尝试获取电子邮件地址时,从Outlook收到一个警告,类似于:
A program is trying to access e-mail address information stored in Outlook.
If this is unexpected, click Deny and verify your antivirus software is up-to-date.
For more information about e-mail safety and how you might be able to avoid getting this warning, click Help.
我希望用户有一个干净的体验(此获取是为了根据他们的邮件地址向应用程序添加新朋友)。Skype可以做到这一点,而不需要Outlook要求用户批准。到目前为止,我发现谷歌叔叔的解决方案大多是肮脏的黑客,我想知道是否有一种干净的方法可以做到这一点。
思想?