var uri = new Uri("http://www.aa.com");
//often cookies are stored on domain level, so ".google.com", not "www.google.com" (leading dot is important)
string host = uri.Host.Replace("www", "");
CookieManager.Add(host, "/", "cookieName", "cookieValue", false, false, false, ConvertDateTimeInt(DateTime.Now.AddYears()));
        /// <summary>
/// DateTime时间格式转换为Unix时间戳格式
/// </summary>
/// <param name="time"> DateTime时间格式</param>
/// <returns>Unix时间戳格式</returns>
public static int ConvertDateTimeInt(System.DateTime time)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(, , ));
return (int)(time - startTime).TotalSeconds;
}

最新文章

  1. MIMO下的MES均方误差详细推导过程
  2. svn服务端和eclipse配合使用
  3. Android 创建自己的Camera App
  4. jsp实现一条横线中间有字的样式
  5. Uploadify 上传文件插件详解
  6. Package &#39;DXCore for Visual Studio&#39; has failed to load properly
  7. Xen入门系列一【使用Xen4CentOS 在 Centos 6 上安装 Xen】
  8. NodeJs随心学习(一)之UEditor开源项目部署
  9. Git 2.7: 一个新的带来许多新特性和性能提升的主要版本
  10. PHP之验证码代码
  11. JavaScript学习笔记(八)——变量的作用域与解构赋值
  12. codeforces 895A Pizza Separation 枚举
  13. [BZOJ 4361]isn
  14. 1.常用turtle功能函数
  15. 【vue】css解决“防抖动”——防止页面加载图片抖动
  16. Codeforces 757 C Felicity is Coming!
  17. C# WCF初识
  18. IOS初级:story board的跳转
  19. python中使用Opencv进行人脸识别
  20. C# 获取北京时间 (根据纪元时间(1970/1/1)转换为DateTime)

热门文章

  1. vmware9.0 install ubuntu
  2. Lotto(DFS处理)
  3. 阿牛的EOF牛肉串-记忆化搜索或动态规划
  4. C# 生成pdf文件客户端下载
  5. jquery动态创建form表单
  6. Hadoop生态系统学习路线
  7. protected (C# Reference)
  8. hdu 4587(枚举+割顶)
  9. 39. Ext.data.SimpleStore的使用方法
  10. Ansi2Utf8 小工具