有时间看看这个gotdotnet的示例,不过它归根结底还是EXE自己读取自己的config,和我说得问题不一样,我的问题是DLL如何读取.exe.config。
As I understand, you want to use custom configuration
data in a DLL assembly which will be used other than ASP .NET application.
Please correct me if there is any misunderstanding. I'd like to share the
following information with you:
1. You can create a .config file for your component with your custom
configuration data in the folder where the executable file (which load the
DLL) resides. Please refer to the following KB article for detailed
information:
HOW TO: Use Custom Configuration Data in a Visual Basic .NET Component
http://support.microsoft.com/?id=321585
2. If you want to create a section handler of you own, you need to extends
the interface IConfigurationSectionHandler. I believe the following article
and sample are helpful:
IConfigurationSectionHandler Interface
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemConfigurationIConfigurationSectionHandlerClassTopic.asp
GotDotNet User Sample: Alternative Config file section readers
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=f184e
04a-37be-48d4-91ad-6eec7552fd40
Please feel free to let me know if you have any problems or concerns.
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Trackback: http://tb.blog.youkuaiyun.com/TrackBack.aspx?PostId=59248
本文介绍如何在DLL中读取.exe.config文件的自定义配置数据,适用于非ASP.NET应用程序。提供了创建.config文件的方法,并介绍了实现自定义配置节处理器的步骤。
1427

被折叠的 条评论
为什么被折叠?



