Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                string userId = NickUtils.GetUserId();
                string nick   = this.nick.Text;
                string pwd    = this.pwd.Text;
                string relPwd = this.relPwd.Text;
                string qqSign = this.qqSign.Text;

                string     name   = userId;
                string     extend = Path.GetExtension(fullFileName);
                GGUserInfo user   = new GGUserInfo()
                {
                    createTime = DateTime.Now, qqSign = qqSign, userId = userId, userImg = (headImg == null ? "" : name + extend), userNickName = nick, userPwd = pwd
                };

                if (ChatDBUtils.RegisterUser(user))
                {
                    HeadImgUtils.SaveRegisterUserHeadImg(this.headImg, user);
                    MessageBox.Show(GGUserUtils.ShowNickAndId(user) + "注册成功");
                }
                else
                {
                    MessageBox.Show(GGUserUtils.ShowNickAndId(user) + "注册失败");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (true)
     {
         List <GGUserInfo> user = ChatDBUtils.GetAllUser();
         foreach (GGUserInfo item in user)
         {
             HeadImgUtils.SaveRegisterUserHeadImg(Image.FromFile(""), item);
         }
         MessageBox.Show("完成");
     }
 }