[global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] [global::System.Configuration.DefaultSettingValueAttribute("Data Source=127.0.0.1;Initial Catalog=MatchDB;Persist Security Info=True;Us" + "er ID=sa;Password=sa")] public string MatchDBConnectionString { get { //下面这几句 var connstr = "MatchDBConnectionString";//web.config里的conn名 return System.Configuration.ConfigurationManager.ConnectionStrings[connstr].ConnectionString ?? ((string)(this["MatchDBConnectionString"])); } }