System.Configuration.AppSettingsReader Class

Assembly: System.dll
Namespace: System.Configuration
Summary
Provides a method for reading values of a particular type from the .config file.
C# Syntax:
public class AppSettingsReader
See also:
System.Configuration Namespace

System.Configuration.AppSettingsReader Member List:

Public Constructors
ctor #1 Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Initializes a new instance of the AppSettingsReader class.
Public Methods
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
GetValue Gets the value for a specified key from the ConfigurationSettings.AppSettings property and returns an object of the specified type containing the value from the .config file.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Configuration.AppSettingsReader Member Details

ctor #1
Summary
Initializes a new instance of the AppSettingsReader class.

Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
public AppSettingsReader();

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~AppSettingsReader();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetValue(
   string key,
   Type type
)
Summary
Gets the value for a specified key from the ConfigurationSettings.AppSettings property and returns an object of the specified type containing the value from the .config file.
C# Syntax:
public object GetValue(
   string key,
   Type type
);
Parameters:

key

The key for which to get the value.

type

The type of the object to return.

Return Value:
The value of the specified key.
Exceptions
Exception Type Condition
ArgumentNullException The key parameter is null.

-or-

The type parameter is null.

InvalidOperationException The value corresponding to the key could not be found in the configuration file.

-or-

The specified type does not have a parser.

-or-

The specified type cannot be parsed.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.