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

推荐订阅源

云风的 BLOG
云风的 BLOG
量子位
H
Help Net Security
月光博客
月光博客
Last Week in AI
Last Week in AI
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
博客园 - Franky
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
Vercel News
Vercel News
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 叶小钗
J
Java Code Geeks
IT之家
IT之家
P
Proofpoint News Feed
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
小众软件
小众软件
Engineering at Meta
Engineering at Meta
U
Unit 42
F
Full Disclosure
B
Blog
The Hacker News
The Hacker News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Simon Willison's Weblog
Simon Willison's Weblog
Microsoft Security Blog
Microsoft Security Blog
Cyberwarzone
Cyberwarzone
V
V2EX
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Spread Privacy
Spread Privacy
Jina AI
Jina AI
GbyAI
GbyAI
博客园 - 三生石上(FineUI控件)
Blog — PlanetScale
Blog — PlanetScale
Know Your Adversary
Know Your Adversary
美团技术团队
罗磊的独立博客
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
S
Schneier on Security
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理

博客园 - zqonline

vs2015 添加行件 关于 OpenSmtp 邮件标题过长后出现乱码问题的解决 大文本编辑程序 混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。 加速度传感器与车祸报警解决方案 sqlserver2008里创建系统管理员 iis+php 运行wordpress所遇到的问题 Winforms下使用TableLayoutPanel进行布局,并解决闪烁及平均列宽与平均行高问题 wince文件同步代码[转] 使用edtftpnet上传文件到Serv-U出现乱码的问题,并且不能创建中文文件名或文件夹。 升级程序到.net 4.0 发现log4net不工作与log4net conversionPattern 说明 uc密码产生方式。 SQLite数据库参数化编程时,采用命名参数的方式 System.Data.SQLite 不能在.net 4.0 里引用的解决方法 初次使用json数据格式,发生的常识性错误。 我电脑上的mssql2000居然,被黑了,在还原数据时提示:无法装载DLL Microsoft提示请误随意操作SQL数据库,以免对数据库造成不必要的麻烦或DLL所引用的某一DLL。原因:126(找不到指定模块) 解决SQL2000出现"无法执行查询,因为文件缺少或未注册。再次运行安装程序确保要求的文件已注册。"的方法 wordpress ImetaWeblog 运行时出现 “child”不是此父级的子控件。
获取 httponly 的 cookie
zqonline · 2012-11-24 · via 博客园 - zqonline
/// <summary>
/// WinInet.dll wrapper
/// </summary>
internal static class CookieReader
{
    /// <summary>
    /// Enables the retrieval of cookies that are marked as "HTTPOnly". 
    /// Do not use this flag if you expose a scriptable interface, 
    /// because this has security implications. It is imperative that 
    /// you use this flag only if you can guarantee that you will never 
    /// expose the cookie to third-party code by way of an 
    /// extensibility mechanism you provide. 
    /// Version:  Requires Internet Explorer 8.0 or later.
    /// </summary>
    private const int INTERNET_COOKIE_HTTPONLY = 0x00002000;

    [DllImport("wininet.dll", SetLastError = true)]
    private static extern bool InternetGetCookieEx(
        string url,
        string cookieName,
        StringBuilder cookieData,
        ref int size,
        int flags,
        IntPtr pReserved);

    /// <summary>
    /// Returns cookie contents as a string
    /// </summary>
    /// <param name="url"></param>
    /// <returns></returns>
    public static string GetCookie(string url)
    {
        int size = 512;
        StringBuilder sb = new StringBuilder(size);
        if (!InternetGetCookieEx(url, null, sb, ref size, INTERNET_COOKIE_HTTPONLY, IntPtr.Zero))
        {
            if (size < 0)
            {
                return null;
            }
            sb = new StringBuilder(size);
            if (!InternetGetCookieEx(url, null, sb, ref size, INTERNET_COOKIE_HTTPONLY, IntPtr.Zero))
            {
                return null;
            }
        }
        return sb.ToString();
    }
}

  参考资料:http://code.msdn.microsoft.com/Remote-Authentication-in-b7b6f43c