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

備註

類別包含HttpContext屬性中 HTTP 要求的相關資訊。 RequestContextThe 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 的淺層複本 (Shallow Copy)。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)

適用於

另請參閱