Esempio n. 1
0
        public static bool InternetGetCookieEX(string url, string cookiename, ref string cookiedata)
        {
            int           length = 1024;
            StringBuilder sb     = new StringBuilder(length);

            //检查Domain是否忘记写http://
            if (url.ToLower().IndexOf("http:") <= 0)
            {
                url = "http://" + url;
            }
            //检查Cookiename
            if (cookiename == "")
            {
                cookiename = null;
            }
            if (Wininet.InternetGetCookie(url, cookiename, sb, ref length))
            {
                cookiedata = sb.ToString();
                return(true);
            }
            else
            {
                return(false);
            }
        }