To check programmatically weather the appSettings tag is present in the web.config file of SharePoint sites, here is the code
using (SPSite site = new SPSite("http://servername:portnumber"))
{
Configuration config = WebConfigurationManager.OpenWebConfiguration("/", mySite.WebApplication.Name);
AppSettingsSection appSettings = config.AppSettings;
bool isAppSettingsTagPresent = appSettings.ElementInformation.IsPresent;
}
hope this helps you very much...
1 comment:
Wow! What an eye opener this post has been for me. Very much appreciated, bookmarked, I can’t wait for more!
Post a Comment