Access sitecore settings programmatically (Sitecore 6)

0 votes
asked Mar 8, 2010 by marto

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

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

2 Answers

0 votes
answered Mar 8, 2010 by driis

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;
0 votes
answered Mar 4, 2012 by sean-holmesby

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.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter

...