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 -  上年纪的程序员  - 有梦就追     

  • 相关阅读:
    mysql
    selenium
    解决servlet响应乱码问题
    flask后端的跨域问题
    python中并发----线程的启动和停止
    react-native 自定义组件规范
    react-native 高阶组件笔记
    class-dump安装及使用
    jekyll的安装
    取巧的json转model声明代码的工具
  • 原文地址:https://www.cnblogs.com/zzxap/p/2175880.html
Copyright © 2011-2022 走看看