System.Configuration +环境变量 [英] System.Configuration + Environment variable

查看:91
本文介绍了System.Configuration +环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试在运行时加载第三方dll。所以我们计划使用System.Configuration。我们想知道是否可以在System.Configuration文件中使用Environment变量。如果是这样,请分享示例。

We are trying to load the third party dll during run time. So we planned to use the System.Configuration. We like to know whether is it possible to use Environment variable in System.Configuration file. If so please share the example also.

推荐答案

不能在app.config中混合环境变量...
Nope yo can not mix environment variables within app.config...


是的,您可以在配置文件中的值中使用环境变量。

但是:在使用其中一个值之前,您必须解析环境变量。您可以为此目的使用 Environment.ExpandEnvironmentVariables
Yes, you can use Environment variables in the values in a configuration file.
BUT: before you use one of those values, you have to resolve the environment variables. You can use Environment.ExpandEnvironmentVariables for that purpose.


这篇关于System.Configuration +环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆