什么是Cookie并给出示例? [英] What is Cookie and give exmples?
本文介绍了什么是Cookie并给出示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请提供您宝贵的建议和答案以及
感谢您的答复.
Please give your valuable suggestions&answers and
thanks for responses.
推荐答案
请先用Google询问,
请参阅这些链接
ASP.NET Cookie入门指南 [ ^ ]
http://asp-net-example.blogspot. in/2009/01/aspnet-cookie-example-how-to-create.html [ http://asp-net-example.blogspot. in/2009/01/aspnet-cookie-example-how-to-create.html [
Please google before ask it
refer these links
Beginner''s Guide to ASP.NET Cookies[^]
http://asp-net-example.blogspot.in/2009/01/aspnet-cookie-example-how-to-create.html[^]
http://asp-net-example.blogspot.in/2009/01/aspnet-cookie-example-how-to-create.html[^]
此处:ASP.NET Cookie入门指南 [
您好,
Cookies
存储在用户浏览器中的一条数据,可以在商店Username&密码,因此用户不必在每次访问时都重新登录到您的网站,Cookie可以将信息保留在用户的浏览器中,直到被删除或过期
Defaul1.aspx
Hi ,
Cookies
a piece of data stored in the user''s browser it can use on store Username & Password so user do not have to re-login to your website every time they visit , Cookies can keep information in the user''s browser until deleted or Expired
Defaul1.aspx
protected void Button1_Click(object sender, EventArgs e) { HttpCookie Cookies = new HttpCookie("UserName"); Cookies.Value = "your value"; Cookies.Expires = DateTime.Now.AddMinutes(3); Response.Cookies.Add(Cookies); Response.Redirect("Default3.aspx"); }
Default3.aspx
Default3.aspx
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HttpCookie cookie = Request.Cookies["UserName"]; if (cookie !=null) { Label1.Text = cookie.Value; } } }
http://www.aspnettutorials.com/tutorials/network/cookies-csharp.aspx [ ^ ]
ASP.NET中的Cookie [有关ASP.NET C#中Cookie的所有信息 [ ^ ]
http://msdn.microsoft.com/en-us/library/ms178194.aspx [ ^ ]
最好的问候
米特瓦里(M.Mitwalli)
http://www.aspnettutorials.com/tutorials/network/cookies-csharp.aspx[^]
Cookies in ASP.NET[^]
all thing about cookies in asp.net c#[^]
http://msdn.microsoft.com/en-us/library/ms178194.aspx[^]
Best Regards
M.Mitwalli
这篇关于什么是Cookie并给出示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文