Example #1
0
        /// <summary>
        /// 窗体加载时
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmLogin_Load(object sender, EventArgs e)
        {
            GetQQ checker = new GetQQ();

            if (checker.Initialize())
            {
                //QQ数据
                list = checker.GetLoginedCache();
                if (list.Count > 0)
                {
                    LoginedInfo item = list[0];
                    item.Head     = btnLogin.Image = HttpHelper.GetUrlImg(string.Format("http://q.qlogo.cn/headimg_dl?bs=qq&dst_uin={0}&spec=100", item.Uin));
                    btnLogin.Text = string.Format("{0}\r\n({1})", item.Name, item.Uin);
                    btnLogin.Tag  = 0;
                    QQItems.Tag   = item;
                }
                else
                {
                    btnLogin.Text = "未检测到账号";
                }
            }
            //居中
            QQItems.Left = (this.Width - QQItems.Width) / 2;
            QQItems.Top  = (this.Height - QQItems.Height) / 2 + 10;
        }
Example #2
0
 /// <summary>
 /// 左移动
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnLeft_Click(object sender, EventArgs e)
 {
     if (btnLogin.Tag != null)
     {
         int SIndex = Convert.ToInt32(btnLogin.Tag);
         SIndex = SIndex == 0 ? list.Count - 1 : SIndex - 1;
         LoginedInfo item = list[SIndex];
         if (item.Head == null)
         {
             item.Head = btnLogin.Image = HttpHelper.GetUrlImg(string.Format("http://q.qlogo.cn/headimg_dl?bs=qq&dst_uin={0}&spec=100", item.Uin));
         }
         else
         {
             btnLogin.Image = item.Head;
         }
         btnLogin.Text = string.Format("{0}\r\n({1})", item.Name, item.Uin);
         btnLogin.Tag  = SIndex;
         QQItems.Tag   = item;
     }
 }
Example #3
0
 public FrmMain(LoginedInfo login)
 {
     InitializeComponent();
     this.Login = login;
 }