VSTO Outlook 插件需要保存设置,最好的方法是什么?

发布于 2024-12-18 15:16:30 字数 117 浏览 2 评论 0原文

我正在编写 VSTO Outlook 插件,我需要保存插件从 Web 服务获取的一些设置。最好的方法是什么?注册表? VSTO 插件是否具有完全访问权限来执行类似的操作?也许是包含设置的文件?

提前致谢。

I'm writing a VSTO Outlook add in and i need to save some settings the addin gets from a web service. What is the best way to do this. Registry? does the VSTO addin have full access to do something like that? Maybe a file containing the settings?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

翻身的咸鱼 2024-12-25 15:16:30

您可以使用设置 ( .settings)文件。

除了具有集中式强类型存储库之外,该文件的优点还在于您可以将这些设置设置为应用程序范围或用户范围。应用程序设置将可供计算机的所有用户使用。用户设置将为每个用户进行个性化设置。 (我相信框架实际上会将这些设置存储在操作系统中某个位置的单独文件中。我不确定,但这并不重要。设置文件的美妙之处在于它会为您处理实际的存储和检索.)

You can use a Settings (.settings) file.

The advantage of this file, besides having a centralized and strongly-typed repository, is that you can make these settings either application-scoped or user-scoped. Application settings will be available to all users of the computer. User settings will be individualized for each user. (I believe the framework will actually store these settings in separate files somewhere in the OS. I'm not sure, but it doesn't matter. The beauty of the Settings file is that it takes care of the actual storage and retrieval for you.)

阿楠 2024-12-25 15:16:30

您可以按照 @Keith 的回答使用设置文件。

该答案的评论中有一些讨论说,如果 Office 版本升级,设置将会丢失,因为设置文件的路径包含 Office 版本号。

虽然这是事实,但有一个简单的解决方案 - 只需使用 设置。升级

You can use a Settings file as per @Keith's answer.

There's some discussion in the comments of that answer saying that the settings will be lost if the Office version is upgraded, because the path to the settings file includes the Office version number.

While that's true, there's an easy solution - simply use settings.Upgrade.

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