System.Web.HttpCookie.cs
| ylbtech-System.Web.HttpCookie.cs |
| 1.程序集 System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a返回顶部 |
#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. 示例返回顶部 |
HttpCookie cookie = new HttpCookie("Mobile", ""); //创建一个Cookie
cookie.Expires = DateTime.Now.AddMinutes(); //设置过期日期和时间
Response.Cookies.Add(cookie); //添加Cookie
#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.返回顶部 |
| 4.返回顶部 |
| 5.返回顶部 |
| 6.返回顶部 |
![]() |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
System.Web.HttpCookie.cs的更多相关文章
- System.Web.HttpSessionStateBase.cs
ylbtech-System.Web.HttpSessionStateBase.cs 1.程序集 System.Web, Version=4.0.0.0, Culture=neutral, Publi ...
- System.Web.HttpContext.cs
ylbtech-System.Web.HttpContext.cs 1.程序集 System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken ...
- System.Web.Mvc.HttpGetAttribute.cs
ylbtech-System.Web.Mvc.HttpGetAttribute.cs 1.程序集 System.Web.Mvc, Version=5.2.3.0, Culture=neutral, P ...
- System.Web.Mvc.RouteAttribute.cs
ylbtech-System.Web.Mvc.RouteAttribute.cs 1.程序集 System.Web.Mvc, Version=5.2.3.0, Culture=neutral, Pub ...
- System.Web.Mvc.HttpPostAttribute.cs
ylbtech-System.Web.Mvc.HttpPostAttribute.cs 1.程序集 System.Web.Mvc, Version=5.2.3.0, Culture=neutral, ...
- System.Web.Mvc.RoutePrefixAttribute.cs
ylbtech-System.Web.Mvc.RoutePrefixAttribute.cs 1.程序集 System.Web.Mvc, Version=5.2.3.0, Culture=neutra ...
- System.Web.UI.WebControls.FileUpload.cs
ylbtech-System.Web.UI.WebControls.FileUpload.cs 1. 程序集 System.Web, Version=4.0.0.0, Culture=neutral, ...
- System.Web.Mvc.JavaScriptResult.cs
ylbtech-System.Web.Mvc.JavaScriptResult.cs 1.程序集 System.Web.Mvc, Version=5.2.3.0, Culture=neutral, P ...
- System.Web.Mvc.ActionResult.cs
ylbtech-System.Web.Mvc.ActionResult.cs 1.程序集 System.Web.Mvc, Version=5.2.3.0, Culture=neutral, Publi ...
随机推荐
- 将一个压缩文件分成多个压缩文件;RAR文件分卷
有时候需要上传压缩文件,但是限制了单个文件的大小,那我们怎么才能将一个比较大的压缩文件分割成多个压缩文件,从而符合要求的进行文件的上传呢?这里小编告诉你一个技巧. 工具/原料 电脑 winrar(一般 ...
- PC端写的API接口和手机端APP联合调试
一.遇到问题的情况:项目框架:asp.net MVC5 ,写的给手机端调用的API接口. 二.自己在本地 IIS上部署项目,在手机端的请求服务器上把地址和端口换上本地部署的,如图所示 三.用管理员的身 ...
- flink idea 打包jar 并放到集群上运行
flink idea 打包jar 并放到集群上运行 在开始之前注意前提,当前项目的scala的版本要和集群上的scala一致 我已经创建好一个wordCount的flink项目 注意项目的po ...
- mysql-5.5.17-win64 安装方法
双击mysql-5.5.17-win64.msi,即开始安装,出现如下界面 2 点击next,出现如下界面,默认为Typical,改选为Custom,单击Next 3 选择MySQL Server后, ...
- TS-接口
接口 TS的核心原则之一是对值所具有的结构进行类型检测 接口初探 function printLabel(labelledObj: { label: string }) { console.log(l ...
- js面向对象的几种方式----工厂模式、构造函数模式、原型模式
对象的字面量 var obj={} 创建实例对象 var obj=new Object() 工厂模式 function cPerson(name,sex,age){ var o = new Objec ...
- NX二次开发-UFUN工程图表格注释设置单元格首选项UF_TABNOT_set_cell_prefs
NX9+VS2012 #include <uf.h> #include <uf_tabnot.h> #include <NXOpen/Part.hxx> #incl ...
- NX二次开发-UFUN输入对象tag获得part名字UF_OBJ_ask_owning_part
NX11+VS2013 #include <uf.h> #include <uf_modl.h> #include <uf_part.h> #include < ...
- arcgis api for javascipt 输出图片
地图模板制作-发布-gpurl调用 window.open可以直接打开url链接. saveas可以另存,仅支持ie浏览器 <!DOCTYPE html><html><h ...
- linux在不关机情况下新增硬盘的方法
开机状态插入硬盘 不关机执行命令 echo "- - -" > /sys/class/scsi_host/host0/scan 注意 echo "- - -&quo ...
