Пример #1
0
        string newpassword;//新密码
        private void btnSmsReset_Click(object sender, EventArgs e)
        {
            Random rd = new Random();

            newpassword = (rd.Next(10000000, 100000000)).ToString();//随机生成一个8位数字密码
            DataSet ds = DBOperate.readDB("select * from UserInfo where UserMobile='" + txtSmsReset.Text.Trim() + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (DBOperate.writeDB("update UserInfo set UserPassword='******' where UserMobile='" + txtSmsReset.Text.Trim() + "'") > 0)
                {
                    String         product         = "Dysmsapi";              //短信API产品名称(短信产品名固定,无需修改)
                    String         domain          = "dysmsapi.aliyuncs.com"; //短信API产品域名
                    String         accessKeyId     = "";                      //accessKeyId,
                    String         accessKeySecret = "";                      //accessKeySecret,
                    IClientProfile profile         = DefaultProfile.GetProfile("cn-hangzhou", accessKeyId, accessKeySecret);
                    //IAcsClient client = new DefaultAcsClient(profile);
                    // SingleSendSmsRequest request = new SingleSendSmsRequest();
                    DefaultProfile.AddEndpoint("cn-hangzhou", "cn-hangzhou", product, domain);
                    IAcsClient     acsClient = new DefaultAcsClient(profile);
                    SendSmsRequest request   = new SendSmsRequest();
                    try
                    {
                        request.PhoneNumbers  = "" + txtSmsReset.Text.Trim() + "";
                        request.SignName      = "雨心的世界";
                        request.TemplateCode  = "SMS_";
                        request.TemplateParam = "{\"password\":\"" + newpassword + "\"}";
                        request.OutId         = "yourOutId";
                        SendSmsResponse sendSmsResponse = acsClient.GetAcsResponse(request);
                        System.Console.WriteLine(sendSmsResponse.Message);
                        MessageBox.Show("重置密码成功、已发送到您的手机!");
                    }
                    catch (ServerException ex)
                    {
                        throw (ex);
                    }
                    catch (ClientException ex)
                    {
                        throw (ex);
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show("重置失败,请联系系统管理员!");
                }
            }
            else
            {
                MessageBox.Show("请输入注册过该平台的手机号");
            }
        }
Пример #2
0
        private void btnDele_Click(object sender, EventArgs e)
        {
            Users u = new Users();

            u.Account = txtNumInfo.Text.Trim();
            if (DBOperate.writeDB("delete from UserInfo where UserAccount='" + u.Account + "'") > 0)
            {
                MessageBox.Show("删除成功!");
                txtNumInfo.Text    = "";
                txtMobileInfo.Text = "";
                txtEmailInfo.Text  = "";
            }
        }
Пример #3
0
        private void btnGDele_Click(object sender, EventArgs e)
        {
            Users u = new Users();

            u.Account = txtGAccount.Text.Trim();
            if (DBOperate.writeDB("delete from UserInfo where UserAccount='" + u.Account + "'") > 0)
            {
                MessageBox.Show("删除成功!");
            }
            else
            {
                MessageBox.Show("删除失败!");
            }
        }
Пример #4
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            Book b = new Book();

            b.ISBN = txtBookISBN1.Text.Trim();
            if (DBOperate.writeDB("delete from Books where ISBN='" + b.ISBN + "'") > 0)
            {
                MessageBox.Show("删除成功!");
            }
            else
            {
                MessageBox.Show("删除失败!");
            }
        }
Пример #5
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            Users u = new Users();

            u.Account = txtNumInfo.Text.Trim();
            u.Mobile  = txtMobileInfo.Text.Trim();
            u.Email   = txtEmailInfo.Text.Trim();
            if (DBOperate.writeDB("update  UserInfo set UserMobile='" + u.Mobile + "',UserEmail='" + u.Email + "' where UserAccount='" + u.Account + "'") > 0)
            {
                MessageBox.Show("修改成功!");
                txtNumInfo.Text    = "";
                txtMobileInfo.Text = "";
                txtEmailInfo.Text  = "";
            }
        }
Пример #6
0
        private void btnGUpdate_Click(object sender, EventArgs e)
        {
            Users u = new Users();

            u.Account = txtGAccount.Text.Trim();
            u.Mobile  = txtGMobile.Text.Trim();
            u.Email   = txtGEmail.Text.Trim();
            if (DBOperate.writeDB("update UserInfo set UserMobile='" + u.Mobile + "',UserEmail='" + u.Email + "' where UserAccount = '" + u.Account + "'") > 0)
            {
                MessageBox.Show("修改成功!");
            }
            else
            {
                MessageBox.Show("修改失败!");
            }
        }
Пример #7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Users u = new Users();

            u.Account = lblNum.Text;
            u.Name    = txtName.Text.Trim();
            u.Mobile  = txtMobile.Text.Trim();
            u.Email   = txtEmail.Text.Trim();
            if (DBOperate.writeDB("update UserInfo set UserName='******',UserMobile='" + u.Mobile + "',UserEmail='" + u.Email + "' where UserAccount='" + u.Account + "'") > 0)
            {
                MessageBox.Show("保存成功!");
            }
            else
            {
                MessageBox.Show("保存失败!");
            }
        }
Пример #8
0
        private void btnEmailReset_Click(object sender, EventArgs e)
        {
            Random rd = new Random();

            newpassword = (rd.Next(10000000, 100000000)).ToString();//随机生成一个8位数字密码
            DataSet ds = DBOperate.readDB("select * from UserInfo where UserEmail='" + txtEmailReset.Text.Trim() + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (DBOperate.writeDB("update UserInfo set UserPassword='******' where UserEmail='" + txtEmailReset.Text.Trim() + "'") > 0)
                {
                    IClientProfile        profile = DefaultProfile.GetProfile("cn-hangzhou", "阿里云", "密钥");
                    IAcsClient            client  = new DefaultAcsClient(profile);
                    SingleSendMailRequest request = new SingleSendMailRequest();
                    try
                    {
                        String pass = "******";width:99.8%;height:99.8%\";><tbody><tr><td style=\";background:#fafafa url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAy0lEQVQY0x2PsQtAYBDFP1keKZfBKIqNycCERUkMKLuSgZnRarIpJX8s3zfcDe9+794du+8bRVHQOI4wDAOmaULTNDDGYFkWMVVVQUTQdZ3iOMZxHCjLElVV0TRNYHVdC7ptW6RpSn3f4wdJkiTs+w6WJAl4DcOAbdugKAq974umaRAEARgXn+cRW3zfFxuiKCJZloXGHMeBbdv4Beq6Duu6Issy7iYB8Jbnucg8zxPLsggnj/zvIxaGIXmeB9d1wSE+nOeZf4HruvABUtou5ypjMF4AAAAASUVORK5CYII=)\";><div style=\";border-radius:10px;font-size:13px;color:#555;width:666px;font-family:'Century Gothic','Trebuchet MS','Hiragino Sans GB','微软雅黑','Microsoft Yahei',Tahoma,Helvetica,Arial,SimSun,sans-serif;margin:50px auto;border:1px solid #eee;max-width:100%;background:#fff repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);box-shadow:0 1px 5px rgba(0,0,0,.15)\";><div style=\";width:100%;background:#49BDAD;color:#fff;border-radius:10px 10px 0 0;background-image:-moz-linear-gradient(0deg,#43c6b8,#ffd1f4);background-image:-webkit-linear-gradient(0deg,#43c6b8,#ffd1f4);height:66px\";><p style=\";font-size:15px;word-break:break-all;padding:23px 32px;margin:0;background-color:hsla(0,0%,100%,.4);border-radius:10px 10px 0 0\";>尊敬的图书馆管理系统用户您好:</p></div><div style=\";margin:40px auto;width:90%\";><p>" + newpassword + "是您的新密码,请牢记</p><p>请注意:此邮件自动发送,请勿直接回复。</p></div></div></td></tr></tbody></table>";
                        request.AccountName    = "你的发信域名";
                        request.FromAlias      = "图书管理系统";
                        request.AddressType    = 1;
                        request.TagName        = "BackPassword";
                        request.ReplyToAddress = true;
                        request.ToAddress      = (txtEmailReset.Text.Trim()).ToString();
                        request.Subject        = "图书管理系统的重置后密码";
                        request.HtmlBody       = pass;
                        SingleSendMailResponse httpResponse = client.GetAcsResponse(request);
                    }
                    finally
                    {
                        MessageBox.Show("邮件发送成功,如未收到请联系系统管理员或者在垃圾箱中寻找");
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show("重置失败,请联系系统管理员!");
                }
            }
            else
            {
                MessageBox.Show("请输入注册过该平台的电子邮箱");
            }
        }
Пример #9
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Book b = new Book();

            b.ISBN      = txtISBN.Text.Trim();
            b.Name      = txtBookName.Text.Trim();
            b.Style     = comboBox1.Text.Trim();
            b.Price     = Convert.ToSingle(txtPrice.Text.Trim());
            b.Press     = txtPress.Text.Trim();
            b.Author    = txtAuthor.Text.Trim();
            b.EnterTime = dateTimePicker1.Value.ToShortDateString();
            if (DBOperate.writeDB("insert into Books values('" + b.ISBN + "','" + b.Name + "','" + b.Style + "','" + b.Price + "','" + b.Press + "','" + b.Author + "','" + b.EnterTime + "','否')") > 0)
            { ///把选择的图片上传给阿里云oss
                if (txtName.Text.Trim() != null)
                {
                    var endpoint        = "oss-cn-beijing.aliyuncs.com";
                    var accessKeyId     = "阿里云";
                    var accessKeySecret = "阿里云密钥";
                    var bucketName      = "c-sharp";
                    var objectName      = @"books/" + txtISBN.Text.Trim() + ".jpg";
                    var localFilename   = @"" + upUserStrBook + "";
                    // 创建OSSClient实例。
                    var client = new OssClient(endpoint, accessKeyId, accessKeySecret);
                    try
                    {
                        // 上传文件。
                        var result = client.PutObject(bucketName, objectName, localFilename);
                        Console.WriteLine("Put object succeeded, ETag: {0} ", result.ETag);
                        MessageBox.Show("上传成功");
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Put object failed, {0}", ex.Message);
                    }
                    MessageBox.Show("保存成功!");
                }
                else
                {
                    MessageBox.Show("保存失败!");
                }
            }
        }
Пример #10
0
        private void btnAlter_Click(object sender, EventArgs e)
        {
            Book b = new Book();

            b.ISBN      = txtBookISBN1.Text.Trim();
            b.Name      = txtBName1.Text.Trim();
            b.Style     = txtBStyle.Text.Trim();
            b.Price     = Convert.ToSingle(txtPrice1.Text.Trim());
            b.Press     = txtPress1.Text.Trim();
            b.Author    = txtAuthor1.Text.Trim();
            b.EnterTime = dateTimePicker2.Value.ToShortDateString();
            b.IsBorrow  = IsBorrow1.Text.Trim();
            if (DBOperate.writeDB("update Books set BookName='" + b.Name + "',BookStyle='" + b.Style + "',Price='" + b.Price + "',Press='" + b.Press + "',Author='" + b.Author + "',EnterTime='" + b.EnterTime + "',IsBorrow='" + b.IsBorrow + "' where ISBN='" + b.ISBN + "'") > 0)
            {
                MessageBox.Show("修改成功!");
            }
            else
            {
                MessageBox.Show("修改失败!");
            }
        }
Пример #11
0
        private void btnReturn_Click(object sender, EventArgs e)//还书按钮事件
        {
            Book br = new Book();

            br.Name = cmbReturn.SelectedItem.ToString();
            DataSet ds = DBOperate.readDB("select * from BRBooks INNER JOIN Books on BRBooks.ISBN=Books.ISBN where BookName='" + br.Name + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                // DBOperate.writeDB("update Books set IsBorrow='否' where ISBN='" + br.ISBN + "'");
                DBOperate.writeDB("update Books set IsBorrow='否' where ISBN=(select ISBN from Books where BookName = '" + br.Name + "')");
                DBOperate.writeDB("delete  from BRBooks where ISBN=(select ISBN from Books where BookName =  '" + br.Name + "')");
                cmbReturn.Items.Remove(cmbReturn.SelectedItem);//移除当前选中项
                cmbReturn.Text = "";
                MessageBox.Show("归还成功");
                DataSet dd = DBOperate.readDB("select * from BRBooks INNER JOIN Books on BRBooks.ISBN=Books.ISBN where BookName='" + br.Name + "'");
                dataGridView3.DataSource = dd.Tables[0];
            }
            else
            {
                MessageBox.Show("请选择你借阅的书");
            }
        }
Пример #12
0
        private void btnBorrow_Click(object sender, EventArgs e)//借书的按钮的事件
        {
            Book br = new Book();

            br.Name = textBox2.Text.Trim();
            DataSet ds = DBOperate.readDB("select * from Books where BookName='" + textBox2.Text.Trim() + "'");

            if (dataGridView2.RowCount >= 1)
            {
                br.IsBorrow = ds.Tables[0].Rows[0][7].ToString();
                if (br.IsBorrow == "是")
                {
                    MessageBox.Show("该书已被借阅");
                    return;
                }
                else
                {
                    br.ISBN = ds.Tables[0].Rows[0][0].ToString();
                    if (DBOperate.writeDB("insert into BRBooks values( '" + br.ISBN + "' ,'" + s + "','" + DateTime.Now.ToShortDateString() + "','" + dateTimePicker1.Value.ToShortDateString() + "')") > 0)
                    {
                        if (DBOperate.writeDB("update Books set IsBorrow='是' where ISBN='" + br.ISBN + "'") > 0)
                        {
                            MessageBox.Show("借阅成功");
                        }
                        else
                        {
                            MessageBox.Show("该书已被借阅");
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("请先输入书名后点击查询!");
            }
        }
Пример #13
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (!account.IsMatch(txtANum.Text.Trim()))
            {
                pictureBox10.Visible = true;
            }
            else
            {
                pictureBox10.Visible = false;
            }
            if (!passWord.IsMatch(txtAPass.Text.Trim()))
            {
                pictureBox9.Visible = true;
            }
            else
            {
                pictureBox9.Visible = false;
            }
            if (!name.IsMatch(txtAName.Text.Trim()))
            {
                pictureBox8.Visible = true;
            }
            else
            {
                pictureBox8.Visible = false;
            }
            if (!tel.IsMatch(txtAMobile.Text.Trim()))
            {
                pictureBox7.Visible = true;
            }
            else
            {
                pictureBox7.Visible = false;
            }
            if (!mail.IsMatch(txtAEmail.Text.Trim()))
            {
                pictureBox1.Visible = true;
            }
            else
            {
                pictureBox1.Visible = false;
            }
            Users u = new Users();

            u.Account  = txtANum.Text.Trim();
            u.Password = txtAPass.Text.Trim();
            u.Name     = txtAName.Text.Trim();
            u.Mobile   = txtAMobile.Text.Trim();
            u.Email    = txtAEmail.Text.Trim();
            DataSet ds  = DBOperate.readDB("select * from UserInfo where UserAccount='" + u.Account + "'");
            DataSet ds1 = DBOperate.readDB("select * from UserInfo where UserMobile='" + u.Mobile + "' and UserEmail='" + u.Email + "'");

            if (txtAPass.Text.Trim() != txtAPass2.Text.Trim())
            {
                MessageBox.Show("两次密码输入不一致!");
                return;
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                MessageBox.Show("当前用户已被注册!");
            }
            else
            {
                if (pictureBox10.Visible || pictureBox9.Visible || pictureBox8.Visible || pictureBox7.Visible || pictureBox1.Visible)
                {
                    MessageBox.Show("信息填写错误!");
                    return;
                }
                else
                {
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        MessageBox.Show("当前用户的手机号或者邮箱已被注册!");
                    }
                    else
                    {
                        if (DBOperate.writeDB("insert into UserInfo values('" + u.Account + "','" + u.Password + "','" + u.Name + "','" + u.Mobile + "','" + u.Email + "','管理员')") > 0)
                        {
                            MessageBox.Show("注册成功!");
                        }
                        else
                        {
                            MessageBox.Show("注册失败!");
                        }
                    }
                }
            }
        }
Пример #14
0
        string upUserStr;//设置一个用于接收上传图片路径的字符串
        private void btnUp_Click(object sender, EventArgs e)
        {
            if (!account.IsMatch(txtNum.Text.Trim()))
            {
                pictureBox2.Visible = true;
            }
            else
            {
                pictureBox2.Visible = false;
            }
            if (!passWord.IsMatch(txtPass.Text.Trim()))
            {
                pictureBox3.Visible = true;
            }
            else
            {
                pictureBox3.Visible = false;
            }
            if (!name.IsMatch(txtName.Text.Trim()))
            {
                pictureBox4.Visible = true;
            }
            else
            {
                pictureBox4.Visible = false;
            }
            if (!tel.IsMatch(textPhone.Text.Trim()))
            {
                pictureBox5.Visible = true;
            }
            else
            {
                pictureBox5.Visible = false;
            }
            if (!mail.IsMatch(txtEmail.Text.Trim()))
            {
                pictureBox6.Visible = true;
            }
            else
            {
                pictureBox6.Visible = false;
            }
            Users u = new Users();

            u.Account  = txtNum.Text.Trim();
            u.Password = txtPass.Text.Trim();
            u.Name     = txtName.Text.Trim();
            u.Mobile   = textPhone.Text.Trim();
            u.Email    = txtEmail.Text.Trim();
            DataSet ds  = DBOperate.readDB("select * from UserInfo where UserAccount='" + u.Account + "'");
            DataSet ds1 = DBOperate.readDB("select * from UserInfo where UserMobile='" + u.Mobile + "' and UserEmail='" + u.Email + "'");

            if (txtPass.Text.Trim() != textPass2.Text.Trim())
            {
                MessageBox.Show("两次密码输入不一致!");
                return;
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                MessageBox.Show("当前用户已被注册!");
            }
            else
            {
                if (pictureBox2.Visible || pictureBox3.Visible || pictureBox4.Visible || pictureBox5.Visible || pictureBox6.Visible)
                {
                    MessageBox.Show("信息填写错误!");
                    return;
                }
                else
                {
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        MessageBox.Show("当前用户的手机号或者邮箱已被注册!");
                    }
                    else
                    {
                        if (DBOperate.writeDB("insert into UserInfo values('" + u.Account + "','" + u.Password + "','" + u.Name + "','" + u.Mobile + "','" + u.Email + "','读者')") > 0)
                        {
                            ///传图
                            if (txtName.Text.Trim() != null)
                            {
                                var endpoint        = "oss-cn-beijing.aliyuncs.com";
                                var accessKeyId     = "阿里云";
                                var accessKeySecret = "阿里云密钥";
                                var bucketName      = "c-sharp";
                                var objectName      = @"users/" + u.Account + ".jpg";
                                var localFilename   = @"" + upUserStr + "";
                                // 创建OSSClient实例。
                                var client = new OssClient(endpoint, accessKeyId, accessKeySecret);
                                try
                                {
                                    // 上传文件。
                                    var result = client.PutObject(bucketName, objectName, localFilename);
                                    Console.WriteLine("Put object succeeded, ETag: {0} ", result.ETag);
                                    MessageBox.Show("上传成功");
                                }
                                catch (Exception ex)
                                {
                                    Console.WriteLine("Put object failed, {0}", ex.Message);
                                }
                            }
                            else
                            {
                                MessageBox.Show("图片上传失败,请联系管理员");
                            }
                            MessageBox.Show("注册成功!");
                        }
                        else
                        {
                            MessageBox.Show("注册失败!");
                        }
                    }
                }
            }
        }
Пример #15
0
        string upUserStr;//设置一个用于接收上传图片路径的字符串
        private void btnUp_Click(object sender, EventArgs e)
        {
            Regex account  = new Regex(@"^[a-zA-Z][a-zA-Z0-9]{6,14}$");
            Regex passWord = new Regex(@"^[a-zA-Z0-9]{4,10}$");
            Regex name     = new Regex(@"^[\u4e00-\u9fa5]{2,}$");
            Regex tel      = new Regex(@"^0?(13|14|15|17|18|19)[0-9]{9}$");
            Regex mail     = new Regex(@"^[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?$");
            Users u        = new Users();

            u.Account  = txtNum.Text.Trim();
            u.Password = txtPass.Text.Trim();
            u.Name     = txtName.Text.Trim();
            u.Mobile   = textPhone.Text.Trim();
            u.Email    = txtEmail.Text.Trim();
            if (!account.IsMatch(txtNum.Text.Trim()))
            {
                pictureBox2.Visible = true;
            }
            else
            {
                pictureBox2.Visible = false;
            }
            if (!passWord.IsMatch(txtPass.Text.Trim()))
            {
                pictureBox3.Visible = true;
            }
            else
            {
                pictureBox3.Visible = false;
            }
            if (!name.IsMatch(txtName.Text.Trim()))
            {
                pictureBox4.Visible = true;
            }
            else
            {
                pictureBox4.Visible = false;
            }
            if (!tel.IsMatch(textPhone.Text.Trim()))
            {
                pictureBox5.Visible = true;
            }
            else
            {
                pictureBox5.Visible = false;
            }
            if (!mail.IsMatch(txtEmail.Text.Trim()))
            {
                pictureBox6.Visible = true;
            }
            else
            {
                pictureBox6.Visible = false;
            }
            DataSet ds  = DBOperate.readDB("select * from UserInfo where UserAccount='" + u.Account + "'");
            DataSet ds1 = DBOperate.readDB("select * from UserInfo where UserMobile='" + u.Mobile + "' and UserEmail='" + u.Email + "'");

            if (txtPass.Text.Trim() != textPass2.Text.Trim())
            {
                MessageBox.Show("两次密码输入不一致!");
                return;
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                MessageBox.Show("当前用户已被注册!");
            }
            else
            {
                if (pictureBox2.Visible || pictureBox3.Visible || pictureBox4.Visible || pictureBox5.Visible || pictureBox6.Visible)
                {
                    MessageBox.Show("信息填写错误!");
                    return;
                }
                else
                {
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        MessageBox.Show("当前用户的手机号或者邮箱已被注册!");
                    }
                    else
                    {
                        if (num == textVerificationCode.Text.Trim())
                        {
                            if (DBOperate.writeDB("insert into UserInfo values('" + u.Account + "','" + u.Password + "','" + u.Name + "','" + u.Mobile + "','" + u.Email + "','读者')") > 0)
                            {
                                ///把选择的图片上传给阿里云oss
                                if (txtName.Text.Trim() != null)
                                {
                                    var endpoint        = "oss-cn-beijing.aliyuncs.com";
                                    var accessKeyId     = "你的阿里云";
                                    var accessKeySecret = "你的密钥";
                                    var bucketName      = "c-sharp";
                                    var objectName      = @"users/" + txtNum.Text.Trim() + ".jpg";
                                    var localFilename   = @"" + upUserStr + "";
                                    // 创建OSSClient实例。
                                    var client = new OssClient(endpoint, accessKeyId, accessKeySecret);
                                    try
                                    {
                                        // 上传文件。
                                        var result = client.PutObject(bucketName, objectName, localFilename);
                                        Console.WriteLine("Put object succeeded, ETag: {0} ", result.ETag);
                                        MessageBox.Show("上传成功");
                                    }
                                    catch (Exception ex)
                                    {
                                        Console.WriteLine("Put object failed, {0}", ex.Message);
                                    }
                                }
                                else
                                {
                                    MessageBox.Show("图片上传失败,请联系管理员");
                                }
                                MessageBox.Show("注册成功!");
                                this.Close();
                            }
                            else
                            {
                                MessageBox.Show("注册失败!");
                            }
                        }
                        else
                        {
                            MessageBox.Show("请输入验证码,或验证码不正确!");
                        }
                    }
                }
            }
        }