使用 C# 在 Outlook 中插入联系人时 CPU 使用率达到 100%?
这个问题与 我的有关将联系人插入 Outlook 的问题。
除了 OOM (Outlook 对象模型)或 Microsoft Outlook 对象库 12.0,所以我最终使用了 OOM。
当我尝试插入 1000 条记录时,我的 CPU 使用率达到 100%。我要关闭联系人,是否需要处理或关闭其他任何东西?
另外,如果我的程序正在运行并且 Outlook 已打开,如果有人关闭 Outlook,则程序会出错。
This question is related to
my question regarding inserting contacts to Outlook.
Nobody was able to suggest any way of doing this beside beside OOM (Outlook Object Model) or Microsoft Outlook object library 12.0, so I ended up using OOM.
When I try to insert 1000 records my CPU usage goes to 100%. I am closing the contact, do I have to dispose of or close anything else?
Also, if my program is running and Outlook is open, if somebody closes Outlook then the program errors out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够通过使用以下两行来解决这个问题。不知道怎么解决,但它得到了解决
GC.WaitForPendingFinalizers();
GC.Collect();
问候
Mohit Thakral
I was able to solve this by using following 2 lines. Dont know how, but it got solved
GC.WaitForPendingFinalizers();
GC.Collect();
Regards
Mohit Thakral