Rambler's Top100
Главная
Новости
Статьи
Форумы
Книги
Коды
Сообщество
Блоги
О нас
 

Логин

Email:
  Пароль:

Войти
Зарегистрироваться
Забыл пароль

Поиск

 Искать :
 
Вперед

Сообщение

Pah


Болтун

Зарегистрирован:
04 July 2005
Сообщения: 276
Примеры кода: 0
 

Re: Чтение любого XML из кастом-секции app.config

19 January 2007 10:56  


Здравствуйте, Ёрик, Вы писали:

Ё>Требуется прочитать кастом-секцию из app.config. Наряду со строго специфицированными тегами требуется прочитать секцию произвольного типа, содержащую любой валидный XML, например:

Ё>Можно ли это сделать на атрибутах типа ConfigurationProperty? Очень не хочется парсить app.config вручную, учитывая то, что остальные теги прекрасно ложатся на атрибуты.

может быть, вот это подойдет

ConfigurationManager



Note: This method is new in the .NET Framework version 2.0.

Retrieves a specified configuration section for the current application's default configuration.

Namespace: System.Configuration
Assembly: System.Configuration (in system.configuration.dll)

Syntax
Visual Basic (Declaration)
Public Shared Function GetSection ( _
sectionName As String _
) As Object

Visual Basic (Usage)
Dim sectionName As String
Dim returnValue As Object

returnValue = ConfigurationManager.GetSection(sectionName)

C#
public static Object GetSection (
string sectionName
)

Parameters
sectionName
The configuration section path and name.



Return Value
The specified ConfigurationSection object, or a null reference (Nothing in Visual Basic) if the section does not exist

ConfigurationSection


Note: This class is new in the .NET Framework version 2.0.

Represents a section within a configuration file.

Namespace: System.Configuration
Assembly: System.Configuration (in system.configuration.dll)

Syntax
Visual Basic (Declaration)
Public MustInherit Class ConfigurationSection
Inherits ConfigurationElement

Visual Basic (Usage)
Dim instance As ConfigurationSection


C#
public abstract class ConfigurationSection : ConfigurationElement

C++
public ref class ConfigurationSection abstract : public ConfigurationElement

J#
public abstract class ConfigurationSection extends ConfigurationElement

JScript
public abstract class ConfigurationSection extends ConfigurationElement


Remarks
You use the ConfigurationSection to implement a custom section type. Extend the ConfigurationSection class to provide custom handling and programmatic access to custom configuration sections.

A section registers its handling type with an entry in the configSections.

Refer to the configuration file excerpt shown in the example next.

Данное сообщение получено с сайта RSDN
Наверх
  



Общие вопросы программирования на ASP.NET

 Чтение любого XML из кастом-секции app.configЁрик  18 January 2007 18:56
 Re: Чтение любого XML из кастом-секции app.configPah  19 January 2007 10:56
 Re: Чтение любого XML из кастом-секции app.configTK  18 January 2007 19:04
 Re[2]: Чтение любого XML из кастом-секции app.configЁрик  18 January 2007 19:39
 
Наш Киев

Apartments for Rent

Rambler's Top100
Рейтинг@Mail.ru
Идея: Dimon aka Manowar Программирование: Dimon aka Manowar Дизайн: Dan Lebedev
Хостинг от компании Parking.ru
Карта сайта