在web.config里这样写
<appSettings> <add key="数据库名" value="info.mdb" /> </appSettings>
用的时候
string test=System.Configuration.ConfigurationSettings.AppSettings["数据库名"];

解决方案 »

  1.   

    config.web? 是你写错了,还是使用beta版的?
    在正式版中应该是web.config文件。String 要读得值=ConfigurationSettings.AppSettings["web.config中的key"];
      

  2.   

    if the values are not in the nodes as mentioned above by two repliers, use XmlDocument class to load the file and read the contents, for example,System.Xml.XmlDocument config = new XmlDocument();
    config.Load( Server.MapPath("web.config") );
    System.Xml.XmlNode authMode = config.SelectSingleNode("/configuration/system.web/authentication/@mode" );
    Application["auth_mode"] = authMode.Value;