惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
爱范儿
爱范儿
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
量子位
罗磊的独立博客
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
小众软件
小众软件
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
大猫的无限游戏
大猫的无限游戏
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
博客园 - 三生石上(FineUI控件)
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园_首页
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
T
The Exploit Database - CXSecurity.com
T
Tailwind CSS Blog
IT之家
IT之家
博客园 - 聂微东
Spread Privacy
Spread Privacy
V2EX - 技术
V2EX - 技术
S
Security Affairs
宝玉的分享
宝玉的分享
V
V2EX
C
Cisco Blogs
博客园 - Franky
美团技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
S
Securelist
J
Java Code Geeks
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
WordPress大学
WordPress大学
W
WeLiveSecurity
T
Threatpost
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志

博客园 - 火龙sky

ASP.NET Ajax发布时异步刷新失效的问题解决方法 关于Tomcat虚拟主机域名的设置--设置本地主机域名 Sql Server 中一个非常强大的日期格式化函数 针对sql 2005优化的高性能分页存储过程 大型网站架构设计 在ASP.NET中记录错误日志(使用Global.asax) 一个完美的的项目经理 CuteEditor6.0 使用 CE寻找游戏基址+偏移 VirtualAllocEx函数 了解游戏外挂 c#做外挂 step by step(更新至step3:注入) Sql-Server应用程序的高级Sql注入 教程: 汇编语言的准备知识-给初次接触汇编者4 教程: 汇编语言的准备知识-给初次接触汇编者3 教程: 汇编语言的准备知识-给初次接触汇编者2 汇编语言的准备知识--给初次接触汇编者 1 邮件简单发送 设置HtmlMeta 值
GetIP cookies
火龙sky · 2008-10-23 · via 博客园 - 火龙sky

        #region 设置Cookies值                        SetCookies(string cookiesname, string cookiesvalue, int Expirestime)
        /// <summary>
        /// 设置Cookies值
        /// </summary>
        /// <param name="cookiesname">名称</param>
        /// <param name="cookiesvalue">内容</param>
        /// <param name="Expirestime">过期时间,0表示默认过期时间</param>
        public static void SetCookies(string cookiesname, string cookiesvalue, int Expirestime)
        {
            HttpContext.Current.Response.Cookies[cookiesname].Value = cookiesvalue;
            if (Expirestime != 0)
                HttpContext.Current.Response.Cookies[cookiesname].Expires = DateTime.Now.AddDays(Expirestime);
        }
        #endregion

        #region 取Cookies值                          string GetCookies(string cookiesname)
        public static string GetCookies(string cookiesname)
        {
            string obj = string.Empty;
            try
            {
                return HttpContext.Current.Request.Cookies[cookiesname].Value;
            }
            catch
            {
                return obj;
            }
        }
        #endregion

        public static string GetIPAddress()
        {

            string user_IP = string.Empty;
            if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null)
            {
                if (System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
                {
                    user_IP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
                }
                else
                {
                    user_IP = System.Web.HttpContext.Current.Request.UserHostAddress;
                }
            }
            else
            {
                user_IP = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();
            }
            return user_IP;
        }