读取当前配置文件的方法
摘要:
var config = ConfigurationManager.OpenExeConfiguration(Assembly.GetAssembly(typeof(ProjectInstaller)).Location); this.serviceInstaller1.ServiceName = config.AppSettings.Settings["ServiceName"].Value;我发现在有些情况下读取应用程序的配置文件会出现ConfigurationManager.AppSettings读取不到的情况,而用上面的代码却可以。比如Windows Servic. 阅读全文
posted @ 2012-11-08 17:12 空明流光 阅读(304) 评论(1) 推荐(0) 编辑