Settings.settings 与 app.config?

发布于 2024-12-03 23:42:44 字数 307 浏览 3 评论 0原文

可能的重复:
app.config 之间有什么区别文件和 XYZ.settings 文件?

这里有什么大的区别?我喜欢使用 Settings.Settings,因为编辑器无法获取 app.config 中的所有 xml。

Possible Duplicate:
What is the difference between app.config file and XYZ.settings file?

Whats the big difference here? I like to use Settings.Settings because og the editor and dont get all the xml in app.config.

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

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

发布评论

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

评论(2

不…忘初心 2024-12-10 23:42:44

Settings.settings 是 Visual Studio 的设计器文件,用于生成设置类,例如 .resx 文件如何保存资源。

设置必须存储在某个地方,但它们不存储在 Settings.settings 中(默认的是)。它们存储在 .config 文件中。

使用生成的类,您可以更新 app.config,而不必担心操作 XML。

Settings.settings is the designer file for Visual Studio to generate the settings class like how .resx files hold resources.

The settings have to be stored somewhere, but they aren't stored in Settings.settings (the default ones are). They are stored in .config files.

With the generated class, you can update the app.config and not worry about manipulating the XML.

最美的太阳 2024-12-10 23:42:44

您不应在设置文件中设置环境值(如连接字符串部分),因为它们在那里不受保护。此外,app.config 中的设置无法从设置文件中设置,因此,在某些时候,您将不得不使用这两个文件。

You shouldn't set the environment values (like connection strings section) in Settings file, because they are unprotected there. Also settings in app.config can't be set from Settings file, so, in some time, you'll have to use both files.

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