• 大小: 4.57MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-21
  • 语言: C#
  • 标签: C#  

资源简介

计算机实训课程设计的代码----使用C#和SQL 大概写了一个学生信息管理系统,数据库没得做关联分析,运行界面也没有做太多的完善,代码有太多不足,希望谅解。

资源截图

代码片段和文件信息

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

namespace WindowsFormsApplication3
{
    public partial class ChangePass : Form
    {
        public static string UserID = ““;
        public ChangePass()
        {
            InitializeComponent();
            this.skinEngine1 = new Sunisoft.IrisSkin.SkinEngine(((System.ComponentModel.Component)(this)));
            this.skinEngine1.SkinFile = Application.StartupPath + “//SteelBlue.ssk“;
        }

        private void button1_Click(object sender EventArgs e)
        {
            string sql = “select Password from UserInformation where UserID=‘“ + textBox1.Text + “‘“;
             SQLServerDatabase sql1 = new SQLServerDatabase();
             SqlConnection cn = sql1.coon();
                cn.Open();
            SqlCommand cmd = new SqlCommand(sql cn);
            SqlDataReader dr = cmd.ExecuteReader();
            if (dr.Read())
            {
                string oldPwd = dr.GetString(0).Trim();
                //获取数据库的中的旧的密码,与现在输入的密码做比较
                if (oldPwd == textBox2.Text)
                {
                    if (textBox3.Text.Trim() == ““ || textBox4.Text.Trim() == ““)
                    {
                        MessageBox.Show(“新密码确认不能为空!“);
                        return;
                    }
                    else if (textBox3.Text.Trim() != textBox4.Text.Trim())
                    {
                        MessageBox.Show(“2次输入的新密码不一样请重新输入!“);
                        textBox3.Text = ““;
                        textBox4.Text = ““;
                        return;
                    }
                    else
                    {
                        dr.Close();
                        string sqlUpdate = “update UserInformation set Password =‘“ + textBox4.Text +
                        “‘ where UserID =‘“ + textBox1.Text + “‘“;
                        SqlCommand cmdUp = new SqlCommand(sqlUpdate cn);
                        if (cmdUp.ExecuteNonQuery() == 0)
                        {
                            MessageBox.Show(“未知错误!“);
                            return;
                        }
                        else
                        {
                            MessageBox.Show(“恭喜你!密码修改成功!“);
                               new System.Threading.Thread(() =>
                              {
                                   Application.Run(new Form1());
                                }).Start();
                            this.Close();
                            
                        }
                    }

                }
                else
                {  MessageBox.Show(“旧密码错误或者不能为空“);
                    textBox2.Text = ““;
                    textBox3.Text = ““;
   

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      13176  2020-01-07 10:05  WindowsFormsApplication12\123.sql

     文件        187  2019-12-27 09:05  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\App.config

     文件     557056  2010-09-12 13:09  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\IrisSkin4.dll

     文件      15664  2010-04-04 21:03  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\mp10green.ssk

     文件     569745  2020-01-02 17:57  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\Setup.exe

     文件      31327  2010-04-04 21:03  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\SteelBlue.ssk

     文件       5900  2020-01-02 17:56  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\Untitled04.nsi

     文件     187904  2020-01-02 17:31  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe

     文件        187  2019-12-27 09:05  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe.config

     文件     118272  2020-01-02 17:31  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.pdb

     文件      24224  2019-12-27 10:39  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe

     文件        187  2019-12-27 09:05  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe.config

     文件        490  2018-09-15 15:29  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe.manifest

     文件     557056  2010-09-12 13:09  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\IrisSkin4.dll

     文件      15664  2010-04-04 21:03  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\mp10green.ssk

     文件     194488  2020-01-02 17:53  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\Setup.exe

     文件      31327  2010-04-04 21:03  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\SteelBlue.ssk

     文件       3497  2020-01-02 17:52  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\Untitled03.nsi

     文件     185856  2020-01-02 17:51  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\WindowsFormsApplication3.exe

     文件        187  2019-12-27 09:05  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\WindowsFormsApplication3.exe.config

     文件      97792  2020-01-02 17:51  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\WindowsFormsApplication3.pdb

     文件      24224  2020-01-02 17:50  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\WindowsFormsApplication3.vshost.exe

     文件        187  2019-12-27 09:05  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\WindowsFormsApplication3.vshost.exe.config

     文件        490  2018-09-15 15:29  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\bin\Release\WindowsFormsApplication3.vshost.exe.manifest

     文件       3697  2019-12-31 19:36  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\ChangePass.cs

     文件       8139  2019-12-31 19:36  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\ChangePass.Designer.cs

     文件      20816  2019-12-31 19:36  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\ChangePass.resx

     文件       4195  2020-01-02 17:30  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\DataAnalyse.cs

     文件      10962  2020-01-02 11:49  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\DataAnalyse.Designer.cs

     文件      20989  2020-01-02 11:49  WindowsFormsApplication12\WindowsFormsApplication3\WindowsFormsApplication3\DataAnalyse.resx

............此处省略112个文件信息

评论

共有 条评论