亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

C# 讀取指定路徑配置文件的方法

 更新時間:2013年03月04日 11:15:13   作者:  
為了實(shí)現(xiàn)多個C#程序共用一個config文件,需要程序讀取指定路徑的config文件。代碼如下:
復(fù)制代碼 代碼如下:

ExeConfigurationFileMap map = new ExeConfigurationFileMap();
            map.ExeConfigFilename = @"F:\App1.config"; ;
            Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
            string connstr = config.ConnectionStrings.ConnectionStrings["connStr"].ConnectionString;
            MessageBox.Show(connstr);
            string key = config.AppSettings.Settings["key"].Value;
            MessageBox.Show(key);

相關(guān)文章

最新評論