惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
AI
AI
SecWiki News
SecWiki News
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Engineering at Meta
Engineering at Meta
博客园 - 叶小钗
The GitHub Blog
The GitHub Blog
Microsoft Azure Blog
Microsoft Azure Blog
N
News and Events Feed by Topic
Cloudbric
Cloudbric
B
Blog
Cisco Talos Blog
Cisco Talos Blog
V
Vulnerabilities – Threatpost
N
News and Events Feed by Topic
V
Visual Studio Blog
A
Arctic Wolf
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
S
Security @ Cisco Blogs
博客园 - 聂微东
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
G
GRAHAM CLULEY
L
LINUX DO - 热门话题
量子位
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Troy Hunt's Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Tenable Blog
月光博客
月光博客
S
Security Affairs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The Hacker News
The Hacker News
Spread Privacy
Spread Privacy
D
Docker
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
博客园 - 司徒正美
T
The Exploit Database - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Help Net Security
Help Net Security
D
DataBreaches.Net

博客园 - DingJun

Javascript 继承方法3 Javascript 继承方法2 Javascript 继承方法1 Call web service from excel Cannot load type (加载页面出错) 几个主流的浏览器引擎及判定 防止数据库日志文件增长 配置发布数据库服务器时碰到错误18483 一些有关。NET界面处理与多线程的文章 不可恢复的生成错误 在.Net安装项目中如何判断操作系统的版本 SQL Server 使用外部连接 在.NET下利用目录服务操纵本机用户和用户组 System.windows.forms.datagrid控件使用技巧 读取配置文件中的自定义节 区域设置与格式化(1) 默认的 IIS MIME 类型关联 在.NET中使用XPath查找指定元素时遇到的麻烦(以dataConfiguration.config为例) 使用Data access block
修改dataConfiguration.config文件
DingJun · 2005-08-12 · via 博客园 - DingJun

示例代码:

/*
            using Microsoft.Practices.EnterpriseLibrary.Configuration;
            using Microsoft.Practices.EnterpriseLibrary.Common;
            using Microsoft.Practices.EnterpriseLibrary.Data;
            using Microsoft.Practices.EnterpriseLibrary.Data.Configuration;
            
*/


            DatabaseSettings dbSetting 
= ConfigurationManager.GetConfiguration("dataConfiguration"as DatabaseSettings;
            ConnectionStringData defaultConnection 
= dbSetting.ConnectionStrings[0];
            MessageBox.Show(defaultConnection.Parameters[
"database"].Value);
            defaultConnection.Parameters[
"Integrated Security"].Value = "True";
            defaultConnection.Parameters[
"database"].Value = "111";
            defaultConnection.Parameters[
"server"].Value = "45345";
            ConfigurationManager.WriteConfiguration(
"dataConfiguration", defaultConnection);

App.config/Web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    
<configSections>
        
<section name="enterpriselibrary.configurationSettings" type="Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationManagerSectionHandler, Microsoft.Practices.EnterpriseLibrary.Configuration" />
        
<section name="exceptionManagement" type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,
                   Microsoft.ApplicationBlocks.ExceptionManagement"
/>
        
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
    
</configSections>
    
<enterpriselibrary.configurationSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" defaultSection="" applicationName="Application" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
    
<configurationSections>
        
<configurationSection name="dataConfiguration" encrypt="false">
        
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="dataConfiguration.config" />
        
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
            
<includeTypes />
        
</dataTransformer>
    
</configurationSection>
    
</configurationSections>
    
<keyAlgorithmStorageProvider xsi:nil="true" />
    
</enterpriselibrary.configurationSettings>    
</configuration>

posted on 2005-08-12 18:49  DingJun  阅读(2735)  评论(3)    收藏  举报