获取与该
Page 对象关联的
HttpResponse 对象。该对象使您得以将 HTTP 响应数据发送到客户端,并包含有关该响应的信息。
命名空间:System.Web.UI
程序集:System.Web(在 system.web.dll 中)
Public ReadOnly Property Response As HttpResponse
Dim instance As Page
Dim value As HttpResponse
value = instance.Response
public HttpResponse Response { get; }
public:
property HttpResponse^ Response {
HttpResponse^ get ();
}
/** @property */
public HttpResponse get_Response ()
public function get Response () : HttpResponse
属性值
当前与该页关联的 HttpResponse。
下面的代码示例演示如何通过使用 HttpResponse 对象创建 Cookie,并将其添加到页的 HTTP 输出。
Dim MyCookie As New HttpCookie("LastVisit")
Dim now As DateTime = DateTime.Now
MyCookie.Value = now.ToString()
MyCookie.Expires = now.AddHours(1)
Response.Cookies.Add(MyCookie)
HttpCookie MyCookie = new HttpCookie("LastVisit");
DateTime now = DateTime.Now;
MyCookie.Value = now.ToString();
MyCookie.Expires = now.AddHours(1);
Response.Cookies.Add(MyCookie);
HttpCookie myCookie = new HttpCookie("LastVisit");
DateTime now = DateTime.get_Now();
myCookie.set_Value(now.ToString());
myCookie.set_Expires(now.AddHours(1));
get_Response().get_Cookies().Add(myCookie);
var myCookie : HttpCookie = new HttpCookie("LastVisit")
var now : DateTime = DateTime.Now
myCookie.Value = now.ToString()
myCookie.Expires = now.AddHours(1)
Response.Cookies.Add(myCookie)
Windows 98、Windows 2000 SP4、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
.NET Framework
受以下版本支持:2.0、1.1、1.0