摘要:
在2.0中已經不建議使用 IConfigurationSectionHandler 接口來實現自定義配置節,而是改用創建 ConfigurationSection 的派生類來創建自定義配置節。現在我希望的配置文件的結構如下:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlight...
閱讀全文
摘要:
1、屬性大小寫問題 比如有這樣一個配置節,其中有三個屬性name,ip,port <Server name="server1" ip="192.168.0.11" port="80" /> 那么對應的類要跟這個名字完全匹配,包括大小寫。 public class Server : ConfigurationElement{ [ConfigurationProperty("name",...
閱讀全文
摘要:
I recently had to deal with creating custom sections in the web/app.config file. In the .NET 1.x realm, I had to create a section handler which implements public class CustomSectionHandler: IConfigura...
閱讀全文