/// <summary>
		/// 得到文档类型的配置
		/// </summary>
		/// <returns>文档类型的配置信息</returns>
		public static ContentTypesSection GetConfig()
		{
			ContentTypesSection settings = (ContentTypesSection)ConfigurationBroker.GetSection("resContentTypes");

			if (settings == null)
				settings = new ContentTypesSection();

			return settings;
		}
        /// <summary>
        /// 根据ContentTypeKey,得到Response的ContentType
        /// </summary>
        /// <param name="key">ContentTypeKey</param>
        /// <returns>ContentType</returns>
        /// <remarks>根据ContentTypeKey,得到Response的ContentType</remarks>
        public static string GetContentTypeByKey(string key)
        {
            ContentTypesSection section = ConfigSectionFactory.GetContentTypesSection();

            key = key.ToLower();
            ContentTypeConfigElement elt = section.ContentTypes[key];

            string contentType = elt != null ? elt.ContentType : string.Empty;

            return(contentType);
        }
        /// <summary>
        /// 得到文档类型的配置
        /// </summary>
        /// <returns>文档类型的配置信息</returns>
        public static ContentTypesSection GetConfig()
        {
            ContentTypesSection settings = (ContentTypesSection)ConfigurationBroker.GetSection("resContentTypes");

            if (settings == null)
            {
                settings = new ContentTypesSection();
            }

            return(settings);
        }
        /// <summary>
        /// 根据文件扩展名,得到Response的ContentType
        /// </summary>
        /// <param name="fileExtesionName">文件扩展名</param>
        /// <returns>ContentType</returns>
        /// <remarks>根据文件扩展名,得到Response的ContentType</remarks>
        public static string GetContentTypeByFileExtesionName(string fileExtesionName)
        {
            string result = string.Empty;

            ContentTypesSection section = ConfigSectionFactory.GetContentTypesSection();

            foreach (ContentTypeConfigElement elt in section.ContentTypes)
            {
                if (StringInCollection(fileExtesionName, elt.FileExtensionNames, true))
                {
                    result = elt.ContentType;
                    break;
                }
            }

            return(result);
        }