• System.Web.HttpCookie.cs


    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 AssembliesMicrosoftFramework.NETFrameworkv4.5.2System.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", "13520690000");    //创建一个Cookie
    cookie.Expires = DateTime.Now.AddMinutes(3);    //设置过期日期和时间
    Response.Cookies.Add(cookie);       //添加Cookie
    2、API 有问题
    #region 权限设置
    HttpCookie cookie = new HttpCookie("cu_mobile", Mobile);    //创建一个Cookie
    if (entity.Status == 0 || entity.Status == 3)
    {
        cookie.Expires = DateTime.Now.AddHours(8).AddMinutes(10);    //设置过期日期和时间
    }
    else
    {
        cookie.Expires = DateTime.Now.AddMinutes(-1);    //设置过期日期和时间
    }
    Response.Cookies.Add(cookie);       //添加Cookie
    #endregion
    3、
    3.返回顶部
     
    4.返回顶部
     
    5.返回顶部
     
     
    6.返回顶部
     
    warn 作者:ylbtech
    出处:http://ylbtech.cnblogs.com/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    Newtonsoft.Json 处理多态类型的反序列化
    33条C#和.NET经典面试题目及答案
    转:原码,反码,补码详解
    使用OpenXML操作Office文档
    WPF的Binding学习笔记(二)
    WPF的Binding学习笔记(一)
    M6: 使用摄像头(CameraCaptureUI)
    M5: 使用StorageFile
    NYOJ144_小珂的苦恼_C++
    搜索水题四连发_C++
  • 原文地址:https://www.cnblogs.com/storebook/p/9063880.html
Copyright © 2020-2023  润新知