web.config 文件
<configuration>
   <appSetting>
<add key="DSN" value="server=.;uid=sa;pwd=;database=pubs">
<add key="SQL_products" value="select * from Products">
   </appSetting>
</configuration>.aspx.cs 文件中:
string con=ConfigurationSettings.
点时怎么点不出来的?还做什么工作吗?

解决方案 »

  1.   

    在vs2005中是ConfigurationManager.Appsettins[""];
      

  2.   

    在VS2005里
    读取Web.config建议使用专用的类
    WebConfigurationManager.AppSettings["DSN"]MSDN:
    使用 WebConfigurationManager 是处理与 Web 应用程序有关的配置文件的首选方法;不推荐使用其他所有方法。对于客户端应用程序,建议使用 ConfigurationManager。
      

  3.   

    我现在是用的确良2003, 为什么点不出来的呀,在职2003  里面是用:
    string con=ConfigurationSettings.AppSettings[""];吧;
    但怎么点不出来的?
      

  4.   

    对了,我没导入System.Configuration
    谢谢你了,给分...
      

  5.   

    using System.Configuration;string str=ConfigurationSettings.AppSettings[""]
      

  6.   

    System.Configuration.ConfigurationSettings.AppSettings[""]