使用 C# 在 Outlook 中插入联系人时 CPU 使用率达到 100%?

发布于 2024-08-20 19:43:12 字数 483 浏览 4 评论 0原文

这个问题与 我的有关将联系人插入 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千纸鹤 2024-08-27 19:43:12

我能够通过使用以下两行来解决这个问题。不知道怎么解决,但它得到了解决

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文