CookieHandler.ReadCore(String, HttpContext) 方法

定义

当在派生类中重写时,将读取与具有指定名称和指定请求关联的 cookie。When overridden in a derived class, reads the cookie that has the specified name and that is associated with the specified request.

protected:
 abstract cli::array <System::Byte> ^ ReadCore(System::String ^ name, System::Web::HttpContext ^ context);
protected abstract byte[] ReadCore (string name, System.Web.HttpContext context);
abstract member ReadCore : string * System.Web.HttpContext -> byte[]
Protected MustOverride Function ReadCore (name As String, context As HttpContext) As Byte()

参数

name
String

Cookie 的名称The name of the cookie

context
HttpContext

该请求的 HttpContextThe HttpContext for the request.

返回

Byte[]

如果未到为 cookie,则为 cookie 值或 nullThe cookie value or null if the cookie was not found

注解

从重载方法调用 Read ,用于执行读取 cookie 的实际工作。Called from the overloaded Read methods to do the actual work of reading the cookie. Read方法将确保 name 为非空字符串。The Read methods will ensure that name is a non-empty string.

实施者说明

必须重写此方法。You must override this method. 实现完全取决于开发人员。The implementation is entirely up to the developer. 在典型情况下,实现将从集合中读取 cookie 数据 Cookies ,不过,这并不是必需的。In the typical case, implementations read the cookie data from the Cookies collection, however, this is not a requirement.

适用于