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)

適用於

另請參閱