• 大小: 1.05MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-12
  • 语言: C#
  • 标签: c#  

资源简介

用c#和sqlserver编写的学生信息管理系统

资源截图

代码片段和文件信息

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

namespace student
{
    public partial class 学生信息管理系统 : Form
    {
        public 学生信息管理系统()
        {
            InitializeComponent();
        }

        private void 取消_Click(object sender EventArgs e)
        {
            Environment.Exit(0);
        }

        private void 登录_Click(object sender EventArgs e)
        {
            DataTable dt = SqlHelper.ExecuteDataTable(“select * from user_Info“);
            int choice = 1;
            if (管理员.Checked)
            {
                choice = 1;
            }
            else if (普通用户.Checked)
            {
                choice = 0;
            }
            int i = 0;
            while (i < dt.Rows.Count)
            {
                DataRow row = dt.Rows[i];
                string name = Convert.ToString(row[“User_name“]);
                string password = Convert.ToString(row[“User_password“]);
                int type = Convert.ToInt32(row[“User_type“]);
                if ((choice == type) && (t_name.Text == name) && (t_password.Text == password))
                {
                 //   MessageBox.Show(“欢迎进入系统“);
                    SqlHelper.UserName=name;
                    SqlHelper.PassWord = password;
                    SqlHelper.UserType=choice;
                    this.Hide();
                    
                    学生管理系统 stumagsys = new 学生管理系统();
                    stumagsys.Show();
                    break;
                }
                else
                    i++;
            }
            if (i == dt.Rows.Count)
            {
                MessageBox.Show(“用户名或密码错误!“);
            }
        }

        private void t_password_KeyDown(object sender KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter) 登录_Click(sender e);

        }

        //判断当键盘按下时候-
  
        
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-04-25 20:51  student\
     目录           0  2012-04-25 20:51  student\student\
     文件         863  2012-04-06 16:01  student\student.sln
     文件       25600  2012-04-14 17:58  student\student.suo
     目录           0  2012-04-25 20:51  student\student\bin\
     目录           0  2012-04-25 20:51  student\student\bin\Debug\
     文件      247296  2012-04-14 17:54  student\student\bin\Debug\student.exe
     文件     2359296  2012-04-13 19:34  student\student\bin\Debug\student.mdf
     文件      140800  2012-04-14 17:54  student\student\bin\Debug\student.pdb
     文件       11600  2012-04-14 17:56  student\student\bin\Debug\student.vshost.exe
     文件         490  2010-03-17 22:39  student\student\bin\Debug\student.vshost.exe.manifest
     文件      589824  2012-04-13 19:34  student\student\bin\Debug\student_log.ldf
     文件        2199  2012-04-13 19:25  student\student\Form1.cs
     文件        7416  2012-04-13 19:25  student\student\Form1.Designer.cs
     文件       28121  2012-04-13 19:25  student\student\Form1.resx
     目录           0  2012-04-25 20:51  student\student\obj\
     目录           0  2012-04-25 20:51  student\student\obj\x86\
     目录           0  2012-04-25 20:51  student\student\obj\x86\Debug\
     文件        4440  2012-04-06 17:57  student\student\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6275  2012-04-14 17:54  student\student\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件        1028  2012-04-13 19:31  student\student\obj\x86\Debug\GenerateResource.read.1.tlog
     文件        7956  2012-04-13 19:31  student\student\obj\x86\Debug\GenerateResource.write.1.tlog
     文件        7897  2012-04-06 17:58  student\student\obj\x86\Debug\ResolveAssemblyReference.cache
     文件        1179  2012-04-14 17:56  student\student\obj\x86\Debug\student.csproj.FileListAbsolute.txt
     文件      247296  2012-04-14 17:54  student\student\obj\x86\Debug\student.exe
     文件      140800  2012-04-14 17:54  student\student\obj\x86\Debug\student.pdb
     文件         180  2012-04-09 12:17  student\student\obj\x86\Debug\student.Properties.Resources.resources
     文件         180  2012-04-13 16:33  student\student\obj\x86\Debug\student.学生信息管理.resources
     文件       15037  2012-04-13 19:31  student\student\obj\x86\Debug\student.学生信息管理系统.resources
     文件       45821  2012-04-09 22:21  student\student\obj\x86\Debug\student.学生管理系统.resources
     文件         180  2012-04-13 10:29  student\student\obj\x86\Debug\student.成绩信息管理.resources
............此处省略34个文件信息

评论

共有 条评论