Get App Setting String : AppDomain « Reflection « C# / C Sharp

Get App Setting String


using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

public class Utils

    public static string GetAppSettingString(AppSettingsSection appSettings, string keyName)
        string rc = null;
        if (appSettings != null)
            KeyValueConfigurationCollection settings = appSettings.Settings;
            string[] names = appSettings.Settings.AllKeys;
            foreach (string name in names)
                if (name == keyName)
                    rc = settings[name].Value;
        return rc;


Related examples in the same category

1.Get AppDomainSetup
2.Assembly loaded event
3.AppDomain.AssemblyResolve Event
4.Gets the base directory that the assembly resolver uses to probe for assemblies.
5.Resets the path that specifies the location of private assemblies to the empty string ("").
6.Creates a new instance of a specified COM type.
7.Creates a new instance of the specified type.
8.Creates a new instance of the specified type defined in the specified assembly file.
9.Gets the current application domain for the current Thread.
10.Defines a dynamic assembly using the specified name, access mode, and storage directory.
11.Gets the friendly name of this application domain.
12.Gets the assemblies that have been loaded into the execution context of this application domain.
13.Loads an Assembly given its AssemblyName.
14.Returns the assemblies that have been loaded into the reflection-only context of the application domain.
15.Establishes security policy level for application domain.
16.Assigns the specified value to the specified application domain property.