In The Hand LtdIn The Hand
AppSettings Property
NamespacesInTheHand.ConfigurationConfigurationManagerAppSettings
.NET Components for Mobility
Gets the appSettings section data for the current application's default configuration.
Declaration Syntax
C#Visual Basic
public static NameValueCollection AppSettings { get; }
Public Shared ReadOnly Property AppSettings As NameValueCollection
	Get
Value
Returns a NameValueCollection object that contains the contents of the appSettings section for the current application's configuration.
Examples
The following code example shows how to use the AppSettings property.
CopyVB.NET
' Show how to use AppSettings.
Shared Sub DisplayAppSettings() 

    ' Get the AppSettings collection.
    Dim appSettings As NameValueCollection = ConfigurationManager.AppSettings

    Dim keys As String() = appSettings.AllKeys

    Debug.WriteLine()
    Debug.WriteLine("Application appSettings:")

    ' Loop to get key/value pairs.
    Dim i As Integer
    For i = 0 To appSettings.Count

        Debug.WriteLine("#{0} Name: {1} Value: {2}", i, keys(i), appSettings(i))
    Next i

End Sub 'DisplayAppSettings
CopyC#
// Show how to use AppSettings.
static void DisplayAppSettings()
{
    // Get the AppSettings collection.
    NameValueCollection appSettings = ConfigurationManager.AppSettings;

    string[] keys = appSettings.AllKeys;

    Debug.WriteLine();
    Debug.WriteLine("Application appSettings:");

    // Loop to get key/value pairs.
    for (int i = 0; i < appSettings.Count; i++)
        Debug.WriteLine("#{0} Name: {1} Value: {2}", i, keys[i], appSettings[i]);
}

Assembly: InTheHand (Module: InTheHand) Version: 7.0.0.0