System.Web.HttpCookie.cs
2024-10-07 22:12:48
ylbtech-System.Web.HttpCookie.cs |
1.程序集 System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a返回顶部 |
1、
#region 程序集 System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Web.dll
#endregion using System.Collections.Specialized;
using System.Reflection; namespace System.Web
{
[DefaultMember("Item")]
public sealed class HttpCookie
{
public HttpCookie(string name);
public HttpCookie(string name, string value); public string this[string key] { get; set; } public string Name { get; set; }
public string Path { get; set; }
public bool Secure { get; set; }
public bool Shareable { get; set; }
public bool HttpOnly { get; set; }
public string Domain { get; set; }
public DateTime Expires { get; set; }
public string Value { get; set; }
public bool HasKeys { get; }
public NameValueCollection Values { get; }
}
}
2、
2. 示例返回顶部 |
1、WebForm
HttpCookie cookie = new HttpCookie("Mobile", ""); //创建一个Cookie
cookie.Expires = DateTime.Now.AddMinutes(); //设置过期日期和时间
Response.Cookies.Add(cookie); //添加Cookie
2、API 有问题
#region 权限设置
HttpCookie cookie = new HttpCookie("cu_mobile", Mobile); //创建一个Cookie
if (entity.Status == || entity.Status == )
{
cookie.Expires = DateTime.Now.AddHours().AddMinutes(); //设置过期日期和时间
}
else
{
cookie.Expires = DateTime.Now.AddMinutes(-); //设置过期日期和时间
}
Response.Cookies.Add(cookie); //添加Cookie
#endregion
3、
3.返回顶部 |
4.返回顶部 |
5.返回顶部 |
6.返回顶部 |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
最新文章
- C#反射机制 (转载)
- 【C-运算符】
- [ZigBee] 3、ZigBee基础实验——GPIO输出控制实验-控制Led亮灭
- django 提示ImportError: cannot import name json_response
- 使用C#实现FTP的文件上传和下载【转】
- Linux for QQ 安装
- BestCoder Round #74
- 火狐浏览器设置placeholder的时候记得改opacity
- [改善Java代码]异步运算考虑使用Callable接口
- Windows Server 2008 R2 安装及配置指南
- Csharp 高级编程 C7.1.2(2)
- UML02-用例图
- canvas实现画板功能(渐变、动画、阴影...)
- [Python] networkx入门 转
- oracle中order by造成分页错误
- Effective Java 第三版——54. 返回空的数组或集合不要返回null
- bzoj3261: 最大异或和 可持久化trie
- ie8下jquery改变PNG的opacity出现黑边
- Android动画及滑动事件冲突解决(转载)
- LNMP-day3-php扩展缓存插件
热门文章
- 用C#简单实现的36进制转换代码
- sublime快捷键汇总
- Servlet(Server Applet) 详解
- 零距离接触阿里云时序时空数据库TSDB
- Java中的线程Thread方法之---join()
- bzoj1016题解
- fastJson中常用方法以及遇到的“坑”
- centos7.2搭建kubernetes1.5.2+dashboard
- 2019 牛客多校第一场 F Random Point in Triangle
- AtCoder ABC 131E Friendships