Ejemplo n.º 1
0
        ///// <summary>
        ///// 登录
        ///// </summary>
        //public void Login()
        //{
        //    if (!isLogin)
        //    {
        //        ThreadPool.QueueUserWorkItem(new WaitCallback(IsLogining));
        //    }
        //}

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="zh"></param>
        /// <param name="mm"></param>
        public bool Login(string zh, string mm, out string msg)
        {
            msg = "";
            if (!isLogin)
            {
                var logindata = HttpService.Login(zh, mm, out msg);
                if (logindata != null && logindata.ticket != null)
                {
                    LoginInfo = logindata;
                    DataManager.Instance.Account  = zh;
                    DataManager.Instance.Password = mm;
                    DataManager.Instance.SetCookies(HttpUtility.UrlDecode(LoginInfo.ticket));
                    IsLogining(null);
                    return(isLogin);
                    //ThreadPool.QueueUserWorkItem(new WaitCallback(IsLogining));
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 登录
 /// </summary>
 /// <param name="zh"></param>
 /// <param name="mm"></param>
 public void Login(string zh, string mm)
 {
     if (!isLogin)
     {
         string msg;
         var    logindata = HttpService.Login(zh, mm, out msg);
         if (logindata != null && logindata.ticket != null)
         {
             LoginInfo = logindata;
             DataManager.Instance.Account  = zh;
             DataManager.Instance.Password = mm;
             DataManager.Instance.SetCookies(LoginInfo.ticket);
             ThreadPool.QueueUserWorkItem(new WaitCallback(IsLogining));
         }
         else
         {
             MessageBox.Show("登录错误!" + msg);
         }
     }
 }