系统配置 [英] System.configuration

查看:92
本文介绍了系统配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是.net Framework 3.5的新手.
我曾经在.net 2.0和Visual Studio 2005中进行编程.

我广泛使用了configurationmanager类(system.configuration),如下所示:

Hi

I am new to the .net framework 3.5.
I had been programming in .net 2.0 and visual studio 2005.

I had extensively used the configurationmanager class (system.configuration) as follows:

public string connectionString {
            get { 
                  if (_connectionString == null) 
                  { _connectionString = ConfigurationManager.ConnectionStrings[1].ToString();  }
                return _connectionString;  
                }
}


现在,当我使用.netframework 3.5& 2008年,我没有看到这堂课.如何访问system.configuration命名空间中的ConfigurationManager类. :((

任何帮助将不胜感激

问候


Now when I am using .netframework 3.5 & 2008, I dont see this class. How do I access the ConfigurationManager class in the system.configuration namespace. :((

Any help would be greatly appreciated

Regards

推荐答案

根据您的发言,听起来您好像认为.NetFrameword 3.5中不再有ConfigurationManager类.如果是这样,这是不正确的.它确实存在,并且尚未删除.

在这里查看: ConfigurationManager类 [
Based on what you say, it sounds like you think there is no ConfigurationManager class anymore in .NetFrameword 3.5. If so, this is not correct. It does exists and has not been removed.

Have a look here: ConfigurationManager Class[^]

Might be you have not referenced System.Configuration.dll in your project. Once referenced the object does exists in System.Configuration
namespace. Try out.


这篇关于系统配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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