代码主要写的是
/// <summary>
/// 获取系统参数配置
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public string GetSystemConfig(string key)
{
Hashtable ht = new Hashtable();
if (HttpRuntime.Cache["SystemConfig"] == null)
{
//重新初始化参数缓存
InitSystemConfigCache();
}
ht = (Hashtable)HttpRuntime.Cache["SystemConfig"];
if (ht != null && ht.Contains(key))
{
return ht[key].ToString();
}
else
{
//重新初始化参数缓存
InitSystemConfigCache();
ht = (Hashtable)HttpRuntime.Cache["SystemConfig"];
return ht.Contains(key) ? ht[key].ToString() : "Wrong Parameter";
}
}
有人知道帮忙解决吗!