以编程方式访问 Sitecore 设置 (Sitecore 6)

发布于 2024-08-24 15:30:25 字数 58 浏览 4 评论 0原文

有没有办法通过代码访问 sitecore 设置。

我感兴趣的具体设置是数据文件夹路径。

Is there a way to get to sitecore settings through code.

The specific setting I'm interested in is the data Folder path.

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

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

发布评论

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

评论(2

陌上芳菲 2024-08-31 15:30:25

如果您想获得其他设置,您可能需要尝试:-

Sitecore.Configuration.Settings.GetSetting("SettingName");

这适用于所有 sitecore 设置,甚至可以通过 App_config/Include 中的配置文件添加的自定义设置。

If you'd like to get other settings, you may want to try:-

Sitecore.Configuration.Settings.GetSetting("SettingName");

This will work for all sitecore settings, even your custom settings that can be added through the config files in the App_config/Include.

生寂 2024-08-31 15:30:25

是的。查看 Sitecore.Configuration.Settings 类(这是 Sitecore 设置的入口点),并使用静态 DataFolder 属性:

string dataFolder = Sitecore.Configuration.Settings.DataFolder;

Yes. Look at the Sitecore.Configuration.Settings class (which is your entry point to the Sitecore settings), and use the static DataFolder property:

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