HttpCapabilitiesSectionHandler 类

定义

帮助读取配置文件的 <browserCaps> 节,并帮助创建包含客户端浏览器功能信息的 HttpBrowserCapabilities 类的实例。Assists in reading in the <browserCaps> section of a configuration file and creating an instance of the HttpBrowserCapabilities class that contains the capabilities information for the client browser.

public ref class HttpCapabilitiesSectionHandler : System::Configuration::IConfigurationSectionHandler
public class HttpCapabilitiesSectionHandler : System.Configuration.IConfigurationSectionHandler
type HttpCapabilitiesSectionHandler = class
    interface IConfigurationSectionHandler
Public Class HttpCapabilitiesSectionHandler
Implements IConfigurationSectionHandler
继承
HttpCapabilitiesSectionHandler
实现

注解

HttpCapabilitiesSectionHandler <browserCaps> .NET Framework 版本2.0 中已弃用类和相应的配置节。The HttpCapabilitiesSectionHandler class and the corresponding <browserCaps> configuration section have been deprecated in the .NET Framework version 2.0. 用于管理浏览器功能的首选方法是通过为类使用而编译的浏览器定义文件 BrowserCapabilitiesFactoryThe preferred method for managing browser capabilities is through browser definition files that are compiled for use by the BrowserCapabilitiesFactory class. 这两种配置方法的目标是生成 HttpBrowserCapabilities 可从类的属性访问的类的实例 Browser HttpRequestThe goal of both configuration methodologies is to generate an instance of the HttpBrowserCapabilities class that can be accessed from the Browser property of the HttpRequest class.

使用浏览器定义文件来存储浏览器功能,可以优于替代方法。Using the browser definition files to store browser capabilities affords advantages over the alternative. 它提高了性能,因为浏览器定义信息是从 XML 配置文件分析的,并预先编译到了类中。It offers improved performance because the browser definition information is parsed from the XML configuration file and compiled into a class ahead of time. 浏览器定义文件也更易于维护:The browser definition files are also easier to maintain:

  • 定义是分层的,因此不依赖正则表达式来确定浏览器的功能。The definitions are hierarchical, and thus rely less on regular expressions to determine the browser capabilities.

  • 定义可以组织到多个文件中,使其更易于管理。The definitions can be organized in multiple files, making them easier to manage.

  • 可以在任何级别定义定义,无论是在 Machine.config 级别还是在特定应用程序级别。The definitions can be defined at any level, either at the Machine.config level or a specific application level. 这样就无需复制整个定义集,目的是为了覆盖特定浏览器的功能。This eliminates the need to copy the entire set of definitions for the purpose of overriding the capabilities for a specific browser.

构造函数

HttpCapabilitiesSectionHandler()

初始化 HttpCapabilitiesSectionHandler 类的新实例。Initializes a new instance of the HttpCapabilitiesSectionHandler class.

方法

Create(Object, Object, XmlNode)

创建包含客户端浏览器功能信息的 HttpBrowserCapabilities 类的实例。Creates an instance of the HttpBrowserCapabilities class that contains the capabilities information for the client browser.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于