1. 程式人生 > >後臺線程讀取指定的web.config

後臺線程讀取指定的web.config

nbsp basedir pps color 讀取配置 sta use ger conf

//讀取配置文件,訂單地址修改接口地址
            ExeConfigurationFileMap configMap = new ExeConfigurationFileMap();
            configMap.ExeConfigFilename = System.AppDomain.CurrentDomain.BaseDirectory + @"Server\Web.config";
            Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);
            
string url = config.AppSettings.Settings["orderStatusSyncUrl"].Value;

後臺線程讀取指定的web.config