示例#1
0
 private void m_pbx_captcha_Click(object sender, EventArgs e)
 {
     m_hg_captcha = HGRestfulAPI.getInstance().getHGCaptcha();
     if (m_hg_captcha != null)
     {
         Console.WriteLine("vtoken " + m_hg_captcha.Vtoken);
         m_pbx_captcha.Image = Helpers.Base64Helper.GetBitmapFromBase64(m_hg_captcha.Img);
     }
     else
     {
         System.Windows.Forms.MessageBox.Show("验证码更新失败,请联系网站管理员");
     }
 }
示例#2
0
 private void m_btn_profile_Click(object sender, EventArgs e)
 {
     // return;
     try
     {
         // bool newOK = HGRestfulAPI.getInstance().newHGAlbum();
         // bool newOK = HGRestfulAPI.getInstance().newHGProgram();
         HGRestfulAPI.getInstance().uploadHGFile(@"D:\zhangguixin\myapps\HGSystem\res\close.png");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            m_uc_offset = 90;

            InitNavigators();

            ButtonExChecked(m_btn_content);

            m_btn_content_Click(this, null);

            try {
                HGData.getInstance().ComCategory = HGRestfulAPI.getInstance().getHGComCategory();
                if (HGData.getInstance().ComCategory == null)
                {
                    MessageBox.Show("获取专辑分类失败,如服务器原因,请联系管理员。");
                }
            } catch (Exception ex)
            {
                MessageBox.Show("获取专辑分类失败,如服务器原因,请联系管理员。错误:" + ex.Message);
                HGData.getInstance().ComCategory = null;
            }
        }
示例#4
0
        private void m_bte_login_Click(object sender, EventArgs e)
        {
            String mobile   = m_tbx_mobile.Text;   // "13488613602";// "15811208494";
            String password = m_tbx_password.Text; // "hongka1018";
            String vcode    = m_tbx_captcha.Text;

            if (DebugHelper.getInstance().FastUserLogin)
            {
                mobile   = "13488613602";
                password = "******";
                vcode    = "eq32";
            }

            if (mobile.Equals("请输入手机号"))
            {
                MessageBox.Show("手机号不能为空");
                return;
            }
            if (password.Equals("请输入密码"))
            {
                MessageBox.Show("密码不能为空");
                return;
            }
            if (vcode.Equals("请输入验证码"))
            {
                MessageBox.Show("验证码不能为空");
                return;
            }
            // TODO: don't do the following, just for debug
            if (DebugHelper.getInstance().IsServerFail&& mobile != null)
            {
                MainForm mf = new MainForm();
                this.Hide();
                mf.ShowDialog();
                Application.ExitThread(); // mainthread change to MainForm
                return;
            }

            if (!isValidMobileNo(mobile))
            {
                MessageBox.Show("请输入正确的手机号");
                m_tbx_mobile.Focus();
                return;
            }

            if (m_hg_captcha == null)
            {
                MessageBox.Show("验证码未更新,请点击验证码图片,重新更新验证码");
                return;
            }

            String vtoken = m_hg_captcha.Vtoken;

            try
            {
                HGUser hgu = HGRestfulAPI.getInstance().login(mobile, password, vcode, vtoken);

                if (hgu != null)
                {
                    HGData.getInstance().User = hgu;
                    MainForm mf = new MainForm();
                    this.Hide();
                    mf.ShowDialog();
                    Application.ExitThread(); // mainthread change to MainForm
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }