31 lines
736 B
C#
31 lines
736 B
C#
namespace Common.UI.Infrastructure
|
|
{
|
|
using System;
|
|
using System.Configuration;
|
|
|
|
public static class Appsettings
|
|
{
|
|
private static readonly string dll = typeof(Appsettings).Assembly.Location;
|
|
|
|
public static string GetSetting(string settingKey)
|
|
{
|
|
var settingValue = default(string);
|
|
|
|
try
|
|
{
|
|
settingValue = ConfigurationManager
|
|
.OpenExeConfiguration(dll)
|
|
.AppSettings
|
|
.Settings[settingKey]
|
|
.Value;
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
AppHost.NLogger.Error(e);
|
|
}
|
|
|
|
return settingValue;
|
|
}
|
|
}
|
|
}
|