/// <summary> /// 获取配置文件中的信息 直接在app.config配置 /// </summary> /// <returns></returns> public static UserConfig GetUserInfo() { UserConfig userConfig = ConfigurationManager.GetSection("UserConfig") as UserConfig; if (userConfig == null || userConfig.Equals(new UserConfig())) { throw new Exception("没有配置节点:UserConfig"); } return(userConfig); }