更新:2007 年 11 月
命名空间:
System.Web.UI 程序集:
System.Web(在 System.Web.dll 中)
<BrowsableAttribute(False)> _
Public ReadOnly Property Response As HttpResponse
Dim instance As Page
Dim value As HttpResponse
value = instance.Response
[BrowsableAttribute(false)]
public HttpResponse Response { get; }
[BrowsableAttribute(false)]
public:
property HttpResponse^ Response {
HttpResponse^ get ();
}
/** @property */
/** @attribute BrowsableAttribute(false) */
public HttpResponse get_Response()
public function get Response () : 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 Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
.NET Framework
受以下版本支持:3.5、3.0、2.0、1.1、1.0
参考