setteacher.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;


namespace LoginFrame
{
    public partial class setteacher : Form
    {
        public setteacher()
        {
            InitializeComponent();
        }

        private void setteacher_Load(object sender, EventArgs e)
        {

        }

        private void btnregedit_Click(object sender, EventArgs e)
        {
            if (loginpwd.Text == loginpwd1.Text)
            {
                SqlConnection conn = new SqlConnection(DbHelper.connString);
                try
                {
                    conn.Open();
                    // 更改老师的密码
                    string sql = string.Format("UPDATE stuinfo set loginpwd='{0}' where loginid='{1}';", loginpwd.Text, username.Text);
                    SqlCommand comm = new SqlCommand(sql, conn);

                    int a = comm.ExecuteNonQuery();
                    if (a == 1)
                    {
                        MessageBox.Show("更改成功!");
                        ad ad = new ad();
                        ad.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("更改失败!");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    conn.Close();
                }
            }
后面还有 15 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。