WindowsFormsApplication1.Form1.login C# (CSharp) Method

login() private method

private login ( ) : Boolean
return Boolean
        private Boolean login()
        {
            qrcode_img.Invoke(new Action(() =>
            {
                this.Controls.Remove(qrcode_img);
                qrcode_img.Dispose();
            }));

            info_display.Invoke(new Action(() =>
            {
                info_display.Location = new System.Drawing.Point(0, 0);
                info_display.Size = new Size(333, 455);
                anchorControls(info_display);
                info_display.Clear();
                info_display.AppendText("正在扫描……" + Environment.NewLine);
            }));            
            var http = WebRequest.Create(redirect_url) as HttpWebRequest;
            http.CookieContainer = cookieContainer;
            var tuple = getResponseText(http, new UTF8Encoding(true, true));
            var data = tuple.Item1;
            XmlDocument doc = new XmlDocument();
            doc.LoadXml(data);
            var root = doc.DocumentElement;
            skey = root.SelectSingleNode("skey").InnerText;
            wxsid = root.SelectSingleNode("wxsid").InnerText;
            wxuin = root.SelectSingleNode("wxuin").InnerText;
            pass_ticket = root.SelectSingleNode("pass_ticket").InnerText;
            var response = (HttpWebResponse)tuple.Item2;
            foreach (Cookie cookie in response.Cookies)
            {
                Console.WriteLine(String.Format("Cookie_in_login: {0}: {1}", cookie.Name, cookie.Value));
            }
            if (String.IsNullOrEmpty(skey) || String.IsNullOrEmpty(wxsid) || String.IsNullOrEmpty(wxuin) || String.IsNullOrEmpty(pass_ticket))
            {
                return false;
            }
            return true;
        }