zoukankan      html  css  js  c++  java
  • 如何读写 app.config

    如何读写 app.config

    using System;
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    using System.Collections.Generic;
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    using System.Text;
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    using System.Configuration;
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    using System.Collections;
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    namespace ServicesConfiguration
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    {
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追    
    public class ConfigurationDispose
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追    
    {
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    public ConfigurationDispose()
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    {
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追         }

    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    #region GetConfiguration
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// <summary>
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// 取得appSettings里的值
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// </summary>
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// <param name="key"></param>
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// <returns></returns>

    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        public static string GetConfiguration(string key)
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    {
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追            
    return ConfigurationManager.AppSettings[key];
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追         }

    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    #endregion

    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    #region GetConfigurationList
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// <summary>
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// 取得appSettings里的值列表
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// </summary>
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// <param name="filePath">配置文件路径</param>
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    /// <returns>值列表</returns>

    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        public static KeyValueConfigurationCollection GetConfigurationList(string filePath)
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    {
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追             AppSettingsSection appSection
    = null;                       //AppSection对象
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
                 Configuration configuration = null;                         //Configuration对象     
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
                 KeyValueConfigurationCollection k = null;                   //返回的键值对类型
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追

    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追             configuration
    = ConfigurationManager.OpenExeConfiguration(filePath);
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追            
    //取得AppSettings节
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
                 appSection = (AppSettingsSection)configuration.Sections["appSettings"];
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追            
    //取得AppSetting节的键值对
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
                 k = appSection.Settings;
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追            
    return k;
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追                    
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追         }

    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追        
    #endregion

    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追
    VS2005 如何读写 app.config -  上年纪的程序员  - 有梦就追     

  • 相关阅读:
    【模拟】HDU 5752 Sqrt Bo
    【数学】HDU 5753 Permutation Bo
    【模拟】Codeforces 706A Beru-taxi
    【二分】Codeforces 706B Interesting drink
    【动态规划】Codeforces 706C Hard problem
    【字典树】【贪心】Codeforces 706D Vasiliy's Multiset
    【中国剩余定理】POJ 1006 & HDU 1370 Biorhythms
    计算机存储单位
    转载_Linux下查看文件和文件夹大小
    反问题_不适定_正则化
  • 原文地址:https://www.cnblogs.com/zzxap/p/2175880.html
Copyright © 2011-2022 走看看