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