/// <summary>
 /// 验证码 - 再次请求 - 接收图片
 /// </summary>
 private static void GetLoginVerifyImage()
 {
     #region 验证码 - 再次请求 - 接收图片
     if (PublicStatic.NowUserOne.CheckResult == "1")
     {
         // 合并请求Uri
         var clientUri = new System.Uri("http://verify.xunlei.com/image");
         // 开始请求
         var check = new HttpClient
             {
             Proxy = null,
             Encoding = System.Text.Encoding.UTF8,
             Cookies = PublicStatic.LoginCookies
         };
         check.Headers.Add(System.Net.HttpRequestHeader.Referer, "http://vod.xunlei.com/home.html");
         var stream = check.OpenRead(clientUri);
         if (stream != null)
         {
             var img = System.Drawing.Image.FromStream(stream);
             if (PublicStatic.YanZhengCode != null)
             {
                 PublicStatic.YanZhengCode.BackgroundImage = img;
                 PublicStatic.YanZhengCode.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
                 // 修改状态符为True
                 PublicStatic.NowUserOne.IsNeedVerifyImage = true;
             }
             else
             {
                 // 接收失败,再次请求
                 GetLoginVerifyImage();
             }
         }
         else
         {
             // 接收失败,再次请求
             GetLoginVerifyImage();
         }
     }
     else
     {
         // 修改标识符为False
         PublicStatic.NowUserOne.IsNeedVerifyImage = false;
     }
     #endregion
 }
 /// <summary>
 /// 登 陆 - 新建请求 - 开始登陆
 /// </summary>
 public static void LoginThunder()
 {
     #region 登 陆 - 新建请求 - 开始登陆
     if (PublicStatic.NowUserOne == null) return;
     if (string.IsNullOrEmpty(PublicStatic.NowUserOne.XlUsername)) return;
     if (string.IsNullOrEmpty(PublicStatic.NowUserOne.XlUserpwd)) return;
     if (PublicStatic.NowUserOne.IsNeedVerifyImage)
     {
         if (string.IsNullOrEmpty(PublicStatic.NowUserOne.XlVerifyCode))
         {
             return;
         }
     }
     // 合成用户密码,三层MD5,在第二层之后加入验证码值
     PublicStatic.NowUserOne.SecurityPassWord =
         PublicStatic.NowUserOne.IsNeedVerifyImage
         ?
         GetMd5Encoding
         (
             GetMd5Encoding
             (
                 GetMd5Encoding
                 (
                     PublicStatic.NowUserOne.XlUserpwd
                 )
             )
             + PublicStatic.NowUserOne.XlVerifyCode.ToUpper()
         )
         :
         GetMd5Encoding
         (
             GetMd5Encoding
             (
                 GetMd5Encoding
                 (
                     PublicStatic.NowUserOne.XlUserpwd
                 )
             )
             + PublicStatic.NowUserOne.CheckResult.Substring(2).ToUpper()
         );
     // 合成登陆字符串,最后的校验码还是后几位
     PublicStatic.NowUserOne.LoginPostData =
         string.Format
         (
             @"u={0}&login_enable=1&login_hour=720&p={1}&verifycode={2}",
             System.Web.HttpUtility.UrlEncode
             (
                 PublicStatic.NowUserOne.XlUsername
             ),
             PublicStatic.NowUserOne.SecurityPassWord,
             System.Web.HttpUtility.UrlEncode
             (
                 PublicStatic.NowUserOne.IsNeedVerifyImage
                 ? PublicStatic.NowUserOne.XlVerifyCode
                 : PublicStatic.NowUserOne.CheckResult.Substring(2).ToUpper()
             )
         );
     // 合成请求地址
     PublicStatic.ClientUri = new System.Uri("http://login.xunlei.com/sec2login/");
     // 开始请求
     using
     (
         var login = new HttpClient
         {
             Proxy = null,
             Encoding = System.Text.Encoding.UTF8,
             Cookies = PublicStatic.LoginCookies,
         }
     )
     {
         login.Headers.Add(System.Net.HttpRequestHeader.Referer, "http://vod.xunlei.com/");
         login.Headers.Add(System.Net.HttpRequestHeader.ContentType, "application/x-www-form-urlencoded");
         login.UploadStringAsync(PublicStatic.ClientUri, "POST", PublicStatic.NowUserOne.LoginPostData);
         login.UploadStringCompleted += Login_UploadStringCompleted;
     }
     #endregion
 }
 /// <summary>
 /// 验证码 - 新建请求 - 开始执行
 /// </summary>
 /// <param name="username"></param>
 public static void LoginThunderYan(string username)
 {
     #region 验证码 - 新建请求 - 开始执行
     // 组合随机数组
     const string fmtDate = "ddd MMM d HH:mm:ss \"\"UTC\"\"zz\"\"00\"\" yyyy";
     var ciDate = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
     var jSstring = System.DateTime.Now.ToString(fmtDate, ciDate);
     // 合并请求Uri
     PublicStatic.ClientUri = new System.Uri(string.Format("http://login.xunlei.com/check?u={0}&t={1}", username, System.Web.HttpUtility.UrlEncode(jSstring)));
     PublicStatic.LoginCookies = new System.Net.CookieContainer();
     // 开始请求
     using
     (
         var check = new HttpClient
         {
             Proxy = null,
             Encoding = System.Text.Encoding.UTF8,
             Cookies = PublicStatic.LoginCookies
         }
     )
     {
         check.Headers.Add(System.Net.HttpRequestHeader.Referer, "http://vod.xunlei.com/home.html");
         check.DownloadStringAsync(PublicStatic.ClientUri);
         check.DownloadStringCompleted += Check_DownloadStringCompleted;
     }
     #endregion
 }
 public static void GetXlHisdoryList()
 {
     if (PublicStatic.NowUserOne != null)
     {
         PublicStatic.LoginCookies = new CookieContainer();
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Sessionid))
         {
             PublicStatic.LoginCookies.Add(new Cookie("sessionid", PublicStatic.NowUserOne.Sessionid, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Userid))
         {
             PublicStatic.LoginCookies.Add(new Cookie("userid", PublicStatic.NowUserOne.Userid, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.VerifyKey))
         {
             PublicStatic.LoginCookies.Add(new Cookie("VERIFY_KEY", PublicStatic.NowUserOne.VerifyKey, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.CheckResult))
         {
             PublicStatic.LoginCookies.Add(new Cookie("check_result", PublicStatic.NowUserOne.CheckResult, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Active))
         {
             PublicStatic.LoginCookies.Add(new Cookie("active", PublicStatic.NowUserOne.Active, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Blogresult))
         {
             PublicStatic.LoginCookies.Add(new Cookie("blogresult", PublicStatic.NowUserOne.Blogresult, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.DownByte))
         {
             PublicStatic.LoginCookies.Add(new Cookie("downbyte", PublicStatic.NowUserOne.DownByte, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.DownFile))
         {
             PublicStatic.LoginCookies.Add(new Cookie("downfile", PublicStatic.NowUserOne.DownFile, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Isspwd))
         {
             PublicStatic.LoginCookies.Add(new Cookie("isspwd", PublicStatic.NowUserOne.Isspwd, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Jumpkey))
         {
             PublicStatic.LoginCookies.Add(new Cookie("jumpkey", PublicStatic.NowUserOne.Jumpkey, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Logintype))
         {
             PublicStatic.LoginCookies.Add(new Cookie("logintype", PublicStatic.NowUserOne.Logintype, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Lsessionid))
         {
             PublicStatic.LoginCookies.Add(new Cookie("lsessionid", PublicStatic.NowUserOne.Lsessionid, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Luserid))
         {
             PublicStatic.LoginCookies.Add(new Cookie("luserid", PublicStatic.NowUserOne.Luserid, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Nickname))
         {
             PublicStatic.LoginCookies.Add(new Cookie("nickname", PublicStatic.NowUserOne.Nickname, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Onlinetime))
         {
             PublicStatic.LoginCookies.Add(new Cookie("onlinetime", PublicStatic.NowUserOne.Onlinetime, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Order))
         {
             PublicStatic.LoginCookies.Add(new Cookie("order", PublicStatic.NowUserOne.Order, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Safe))
         {
             PublicStatic.LoginCookies.Add(new Cookie("safe", PublicStatic.NowUserOne.Safe, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Score))
         {
             PublicStatic.LoginCookies.Add(new Cookie("score", PublicStatic.NowUserOne.Score, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Sessionid))
         {
             PublicStatic.LoginCookies.Add(new Cookie("sessionid", PublicStatic.NowUserOne.Sessionid, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Sex))
         {
             PublicStatic.LoginCookies.Add(new Cookie("sex", PublicStatic.NowUserOne.Sex, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Upgrade))
         {
             PublicStatic.LoginCookies.Add(new Cookie("upgrade", PublicStatic.NowUserOne.Upgrade, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Userid))
         {
             PublicStatic.LoginCookies.Add(new Cookie("userid", PublicStatic.NowUserOne.Userid, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Usernewno))
         {
             PublicStatic.LoginCookies.Add(new Cookie("usernewno", PublicStatic.NowUserOne.Usernewno, "/", "xunlei.com"));
         }
         if (!string.IsNullOrEmpty(PublicStatic.NowUserOne.Usernick))
         {
             PublicStatic.LoginCookies.Add(new Cookie("usernick", PublicStatic.NowUserOne.Usernick, "/", "xunlei.com"));
         }
     }
     PublicStatic.ClientUri = new Uri("http://i.vod.xunlei.com/req_history_play_list/req_num/30/req_offset/0?type=all&order=create&t=1375654135070");
     // 开始请求
     using
     (
         var check = new HttpClient
         {
             Proxy = null,
             Encoding = System.Text.Encoding.UTF8,
             Cookies = PublicStatic.LoginCookies
         }
     )
     {
         check.Headers.Add(System.Net.HttpRequestHeader.Referer, "http://vod.xunlei.com/list.html?userid=" + PublicStatic.NowUserOne.Userid);
         check.DownloadStringAsync(PublicStatic.ClientUri);
         check.DownloadStringCompleted += check_DownloadStringCompleted;
     }
 }