在网上搜索了一下.说是可以用InternetGetCookie这个api来获得cookie
用以下代码
 [System.Runtime.InteropServices.DllImport("wininet.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)]
        public static extern bool InternetGetCookie(string lpszUrlName, string lpszCookieName, StringBuilder lpszCookieData, ref int lpdwSize);
        [System.Runtime.InteropServices.DllImport("kernel32.dll")]
        internal static extern Int32 GetLastError();        public static string GetCookie(string url) //Win32 API
        {
            int size = 1000;
            StringBuilder sb = new StringBuilder(size);            if (!InternetGetCookie(url, "", sb, ref size))
            {
                Console.WriteLine("Error code:{0}", GetLastError());
            }
            return sb.ToString();
        }
  static void Main(string[] args)
        {
            System.Console.WriteLine(GetCookie("http://www.google.com/"));
        }返回错误结果Error code:259网上写着说什么不支持xp sp2.不知道有没有什么解决方法?