12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Configuration;
- namespace SCC.Common
- {
-
-
-
- public static class ConfigHelper
- {
-
-
-
-
-
- public static object GetConfigValue(string key)
- {
- return ConfigurationManager.AppSettings[key];
- }
-
-
-
-
-
-
-
- public static T GetConfigValue<T>(string key)
- {
- try
- {
- object o = ConfigurationManager.AppSettings[key];
- if (o != null)
- {
- return CommonHelper.ChangeType<T>(o);
- }
- }
- catch { }
- return default(T);
- }
- }
- }
|