Inheritance: System.Windows.Forms.Form
Beispiel #1
0
 private static extern IntPtr ShellExecute(IntPtr hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, frmMain.ShowCommands nShowCmd);
Beispiel #2
0
        private void doLogin()
        {


            if (this.txt_userName.Text.Replace("用户名/手机号码/QQ", "").Trim() == "")
            {
                int num2 = (int)MessageBox.Show("请输入用户名.");
            }
            else if (this.txt_pwd.Text.Trim() == "")
            {
                int num3 = (int)MessageBox.Show("请输入密码.");
            }
            else
            {
                this.Hide();
                usersClass usersClass = new usersClass();
                string stu = DateTime.Now.ToString("yyyy-MM-hh HH:mm:ss");
                DataTable dataTable = usersClass.login(this.txt_userName.Text.Trim(), this.txt_pwd.Text.Trim(), stu);
                if (dataTable.Rows.Count > 0)
                {
                    if (this.checkBox1.Checked)
                    {
                        AppConfig.SetValue("s1", "1");
                        string str1 = this.txt_userName.Text.Trim();
                        string str2 = "$";
                        DateTime dateTime = DateTime.Now;
                        dateTime = dateTime.AddDays(512.0);
                        string str3 = Encrypt.md5Encrypt(dateTime.ToString("yyyy-MM-dd HH:mm:ss") + this.txt_pwd.Text.Trim(), "ll13715**tb!");
                        AppConfig.SetValue("s2", str1 + str2 + str3);
                    }
                    else
                    {
                        AppConfig.SetValue("s1", "0");
                        AppConfig.SetValue("s2", "");
                    }
                    UsersTBSturct usersTbSturct = new UsersTBSturct();
                    usersTbSturct.lastAceive = stu;
                    usersTbSturct.ID = Convert.ToInt32(dataTable.Rows[0]["ID"].ToString().Trim());
                    usersTbSturct.userName = dataTable.Rows[0]["userName"].ToString();
                    usersTbSturct.phone = dataTable.Rows[0]["phone"].ToString().Trim();
                    usersTbSturct.pwd = this.txt_pwd.Text.Trim();
                    usersTbSturct.QQ = dataTable.Rows[0]["QQ"].ToString().Trim();
                    usersTbSturct.WW = dataTable.Rows[0]["WW"].ToString().Trim();
                    usersTbSturct.QT_name = dataTable.Rows[0]["QT_name"].ToString().Trim();
                    usersTbSturct.QT_Js = dataTable.Rows[0]["QT_Js"].ToString().Trim();
                    usersTbSturct.Price = Convert.ToDouble(dataTable.Rows[0]["price"].ToString().Trim());
                    if ((int)Convert.ToInt16(dataTable.Rows[0]["hydj"].ToString().Trim()) == 0)
                    {
                        usersTbSturct.endDate = dataTable.Rows[0]["endDate"].ToString().Trim();
                    }
                    else
                    {
                        usersTbSturct.endDate = "无限制";
                    }
                    usersTbSturct.regDate = dataTable.Rows[0]["regDate"].ToString().Trim();
                    usersTbSturct.hyDj = (int)Convert.ToInt16(dataTable.Rows[0]["hydj"].ToString().Trim());
                    usersTbSturct.TJR = dataTable.Rows[0]["tjr"].ToString().Trim();
                    usersTbSturct.xm = dataTable.Rows[0]["xm"].ToString().Trim();
                    usersTbSturct.ZFB = dataTable.Rows[0]["zfb"].ToString().Trim();
                    usersTbSturct.url = dataTable.Rows[0]["url"].ToString().Trim();
                    usersTbSturct.isEnable = (int)Convert.ToInt16(dataTable.Rows[0]["isEnable"].ToString().Trim());
                    usersTbSturct.isAdin = (int)Convert.ToInt16(dataTable.Rows[0]["isAdin"].ToString().Trim());
                    usersTbSturct.purStr = "|" + dataTable.Rows[0]["purStr"].ToString().Trim() + "|";
                    usersTbSturct.msg = dataTable.Rows[0]["msg"].ToString().Trim();
                    if (usersTbSturct.isEnable == 2)
                    {
                        string text = "对不起,您的帐号己被冻结,请与管理员联系!";
                        if (dataTable.Rows[0]["msg"].ToString().Trim() != "")
                            text = dataTable.Rows[0]["msg"].ToString().Trim();
                        this.Show();
                        int num4 = (int)MessageBox.Show(text);
                    }
                    else if (usersTbSturct.isEnable == 1)
                    {
                        string text = usersTbSturct.msg.Trim();
                        if (text == "")
                            text = "帐号审核中,请稍候再试!";
                        this.Show();
                        int num4 = (int)MessageBox.Show(text);

                    }
                    else if (usersTbSturct.hyDj == 0 && Convert.ToDateTime(usersTbSturct.endDate) < DateTime.Now)
                    {
                       
                        if (MessageBox.Show("对不起,您的有效期己过,加入VIP后可以继续使用!请点击确定了解") != DialogResult.OK)
                            
                        this.Show();
                
                        System.Diagnostics.Process.Start("http://aliuliang.net/");
                        return;
                    }
                    else
                    {

                       sys.LoginUser = usersTbSturct;
                        
                        this.DialogResult = DialogResult.OK;
                        button1.Enabled = false;

                        frmMain frmMain = new frmMain(this);
                        frmMain.Show();
                        //frmMain.Hide();

                    }
                }
                else
                {
                    MessageBox.Show("登录失败");
                    button1.Enabled = true;
                    this.Show();
                }
            }
        }