Skip to content

Instantly share code, notes, and snippets.

@burgwyn burgwyn/gist:5602186
Created May 17, 2013

Embed
What would you like to do?
This snippet iterates through the AppSettings entries and returns an unordered list of bolded keys and values. I like to add this to the 'About' page that comes bundled in the web project templates in Visual Studio.
StringBuilder sb = new StringBuilder();
if (ConfigurationManager.AppSettings.HasKeys())
{
sb = new StringBuilder( "<ul style=\"list-style-type:none;\">" );
foreach (string key in ConfigurationManager.AppSettings.Keys)
{
sb.AppendFormat( "<li><strong>{0}</strong> - {1}</li>", key, ConfigurationManager.AppSettings[key] );
}
sb.Append( "</ul>" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.