.NET 2.0中,使用ConfigureManager读写配置文件

 在.NET 2.0中,使用了新的ConfigurationManager类进行配置文件的操作,使用方法如下:

先要在引用中添加一个System.Configuration的dll文件才可以在项目中调用该类。

如果在VS.NET 2005使用.NET 1.1版本中的ConfigurationSettings,则编译器会提示:

'System.Configuration.ConfigurationSettings.AppSettings' is obsolete:'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings'

这表明VS.NET 2005已将ConfigurationSettings视为过时的方法了。

你可能感兴趣的:(.NET 2.0中,使用ConfigureManager读写配置文件)