In The Hand LtdIn The Hand
ConfigurationManager Class
NamespacesInTheHand.ConfigurationConfigurationManager
.NET Components for Mobility
Provides access to configuration files for client applications.
Declaration Syntax
C#Visual Basic
public static class ConfigurationManager
Public NotInheritable Class ConfigurationManager
Members
All MembersProperties



IconMemberDescription
AppSettings
Gets the appSettings section data for the current application's default configuration.

Remarks
Equivalent to System.Configuration.ConfigurationManager
Examples
The following code example shows how to use the ConfigurationManager class to access the appSettings configuration section.
CopyVB.NET
Imports System
Imports System.Collections.Specialized
Imports System.Collections.ObjectModel
Imports System.Collections
Imports System.Text
Imports System.Configuration

Class UsingConfigurationManager

    ' 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


    Shared Sub Main(ByVal args() As String) 

        ' Show how to use AppSettings.
        DisplayAppSettings()

    End Sub 'Main 


End Class 'UsingConfigurationManager
CopyC#
using System;
using System.Collections.Specialized;
using System.Collections.ObjectModel;
using System.Collections;
using System.Text;
using System.Configuration;

namespace InTheHand.Samples
{
    class UsingConfigurationManager
    {
        // 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]);
        }

        static void Main(string[] args)
        {
            // Show how to use AppSettings.
            DisplayAppSettings();
        }
    }
}
Inheritance Hierarchy
Object
ConfigurationManager

Assembly: InTheHand (Module: InTheHand) Version: 7.0.0.0