Пример #1
0
        public ActionResult Index4()
        {
            string aaa = ConfigMangerHelper.Get <string>("Luolu");

            //Common.Test.Instance().fangfa(true);
            return(View());
        }
Пример #2
0
 public static string Get(string key, string defaultvalue = "")
 {
     if (key == "ConfigManagerConnectString" || key == "ProjectName" || ProjectName == "未命名项目" || string.IsNullOrWhiteSpace(ProjectName) || string.IsNullOrWhiteSpace(ConfigManagerConnectString))
     {
         if (System.Configuration.ConfigurationManager.AppSettings.AllKeys.Contains(key))
         {
             return(System.Configuration.ConfigurationManager.AppSettings[key]);
         }
         else
         {
             return(defaultvalue);
         }
     }
     else
     {
         try
         {
             var value = ConfigMangerHelper.Get <string>(key);
             if (value != null)
             {
                 return(value);
             }
         }
         catch
         {
             return(defaultvalue);
         }
     }
     return(defaultvalue);
 }