RequestContext RequestContext RequestContext RequestContext Class

定义

封装与所定义路由匹配的 HTTP 请求的相关信息。Encapsulates information about an HTTP request that matches a defined route.

public ref class RequestContext
public class RequestContext
type RequestContext = class
Public Class RequestContext
继承
RequestContextRequestContextRequestContextRequestContext

注解

RequestContext类包含有关 HTTP 请求中的信息HttpContext属性。The RequestContext class contains information about the HTTP request in the HttpContext property. 它包含有关与当前请求中的匹配的路由信息RouteData属性。It contains information about the route that matched the current request in the RouteData property.

实例时构造来自路由的 URL,请传递RequestContext类来RouteCollection.GetVirtualPath方法。When you construct a URL from a route, you pass an instance of the RequestContext class to the RouteCollection.GetVirtualPath method.

构造函数

RequestContext() RequestContext() RequestContext() RequestContext()

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

RequestContext(HttpContextBase, RouteData) RequestContext(HttpContextBase, RouteData) RequestContext(HttpContextBase, RouteData) RequestContext(HttpContextBase, RouteData)

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

属性

HttpContext HttpContext HttpContext HttpContext

获取有关 HTTP 请求的信息。Gets information about the HTTP request.

RouteData RouteData RouteData RouteData

获取有关所请求路由的信息。Gets information about the requested route.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

适用于

另请参阅