我在web.config里面写了连接字符串,然后在类中用System.Configuration.ConfigurationSettings.AppSettings引用,生成的时候就出现了这个错误!各位大虾告诉我啊!怎么弄!警告“System.Configuration.ConfigurationSettings.AppSettings”已过时
:“This method is obsolete, it has been replaced by System.Config
:“This method is obsolete, it has been replaced by System.Config
警告“System.Configuration.ConfigurationSettings.AppSettings”已过时
:“This method is obsolete, it has been replaced by System.Config这只是个警告,编译器告诉你新版本下(.net 2.0) System.Configuration.ConfigurationSettings.AppSettings 已经废弃,以后可能不再支持2。
你应该使用新版本的 ConfigurationManager 类,如下:string connStr = System.Configuration.ConfigurationManager.AppSettings["SqlConnStr"];记得,添加对 System.Configuration.dll 的引用