public class DomainHelper { public static void SetDomainValue(string key, object password) { AppDomain.CurrentDomain.SetData(key, password); } public static T GetDomainValue<T>(string key) { object value=AppDomain.CurrentDomain.GetData(key) ; if(value==null)return default(T); return (T)value; } }