/// <summary> /// 获取App.config配置文件某个节点的值 /// </summary> /// <param name="name">节点名称</param> /// <returns></returns> private string GetConfigValue(string name) { ExeConfigurationFileMap map = new ExeConfigurationFileMap(); //另一个程序App.config配置文件所在的路径 map.ExeConfigFilename = AppDomain.CurrentDomain.BaseDirectory + "//updater.config"; Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None); return config.AppSettings.Settings[name].Value; }
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/280718.html