当前位置:编程学习 > C#/ASP.NET >>

急!InternetGetCookieEx返回总是空!错误码87

程序在别的电脑上运行很多个了。没事。

老本本上也一切正常。取的到。

但在新本本上,又是不行了。取啥网址都是空。错误码87.。说是参数不正确。。

        public static string GetCookieString(string url)
        {
            // Determine the size of the cookie     
            int datasize = 256;
            StringBuilder cookieData = new StringBuilder(datasize);
            if (!InternetGetCookieEx(url, null, cookieData, ref datasize, 0x00002000, null))
            {
                if (datasize < 0)
                    return null;
                // Allocate stringbuilder large enough to hold the cookie     
                cookieData = new StringBuilder(datasize);
                if (!InternetGetCookieEx(url, null, cookieData, ref datasize, 0x00002000, null))
                {
                    int reCode = Marshal.GetLastWin32Error();
                    
                    return null;
                }
            }
            return cookieData.ToString();
        }

这代码用了挺久了,只有在我这新本本上才用不了。。郁闷啊。。。。。没修改过

谁知道是啥原因,咋解决。 InternetGetCookieEx http://emao.me  --------------------编程问答--------------------  我擦。。自己解决了。闪人。 --------------------编程问答-------------------- INTERNET_COOKIE_HTTPONLY参数要求IE8以上,确定?
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,