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

  • 相关阅读:
    用webclient.DownloadFile下载exe文件时大小为0
    C# ,asp.net 获取当前,相对,绝对路径(转)
    c#读取进程列表判断程序是否已经启动(转)
    如何提升页面渲染效率
    前端知识点总结——VUE
    ie7ajax 跨域 no transport 解决办法
    酷炫网址
    框架学习官网
    JavaScript数组方法大全(推荐)
    rem是如何实现自适应布局的
  • 原文地址:https://www.cnblogs.com/zzxap/p/2175880.html
Copyright © 2011-2022 走看看