資源簡介
這是一個基于C#的學生管理系統,可以作為C#的課程設計。
代碼片段和文件信息
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;
using?Library.Dao;
using?System.Data.SqlClient;
using?Library.Class;
namespace?Student_Course_System
{
????public?partial?class?Form1?:?Form
????{
????????Connection?conn?=?new?Connection();
????????string?sql?=?““;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????List?list?=?new?List();
????????????list.Add(new?Items(0?“管理員登錄“));
????????????list.Add(new?Items(1?“學生登錄“));
????????????comboBox1.DataSource?=?list;
????????????comboBox1.DisplayMember?=?“Text“;
????????????comboBox1.ValueMember?=?“Value“;
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????string?username?=?textBox1.Text;
????????????string?password?=?textBox2.Text;
????????????if?(username?!=?““?&&?password?!=?““)
????????????{
????????????????if?(Convert.ToInt32(comboBox1.SelectedValue)?==?0)
????????????????{
????????????????????sql?=?“select?COUNT(*)?from?Admin?where?loginName=‘“?+username+?“‘?and?password=‘“?+password+?“‘;“;
????????????????????if?(conn.getRow(sql)?>?0)
????????????????????{
????????????????????????Form2?f2?=?new?Form2(username);
????????????????????????this.Hide();
????????????????????????f2.ShowDialog();
????????????????????}
????????????????????else
????????????????????{
????????????????????????MessageBox.Show(“管理員不存在或密碼錯誤“);
????????????????????}
????????????????}
????????????????else?if?(Convert.ToInt32(comboBox1.SelectedValue)?==?1)
????????????????{
????????????????????sql?=?“select?COUNT(*)?from?Student?where?stuID=‘“?+username+?“‘?and?password=‘“?+password+?“‘;“;
????????????????????if?(conn.getRow(sql)?>?0)
????????????????????{
????????????????????????Form7?f7?=?new?Form7(username);
????????????????????????this.Hide();
????????????????????????f7.ShowDialog();
????????????????????}
????????????????????else
????????????????????{
????????????????????????MessageBox.Show(“學號未注冊或密碼錯誤“);
????????????????????}
????????????????}
????????????}
????????????else
????????????{
????????????????MessageBox.Show(“用戶名或者密碼不能為空“);
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????47104??2016-05-28?17:10??學生成績管理系統\Student_Course_System\Student_Course_System\bin\Debug\Student_Course_System.exe
?????文件?????105984??2016-05-28?17:10??學生成績管理系統\Student_Course_System\Student_Course_System\bin\Debug\Student_Course_System.pdb
?????文件??????11600??2016-05-28?17:06??學生成績管理系統\Student_Course_System\Student_Course_System\bin\Debug\Student_Course_System.vshost.exe
?????文件????????490??2012-06-06?02:06??學生成績管理系統\Student_Course_System\Student_Course_System\bin\Debug\Student_Course_System.vshost.exe.manifest
?????文件????????594??2016-05-27?14:59??學生成績管理系統\Student_Course_System\Student_Course_System\Class\Items.cs
?????文件???????1804??2016-05-28?17:10??學生成績管理系統\Student_Course_System\Student_Course_System\Dao\Connection.cs
?????文件???????2492??2016-05-28?15:49??學生成績管理系統\Student_Course_System\Student_Course_System\Form1.cs
?????文件???????4878??2016-05-27?15:06??學生成績管理系統\Student_Course_System\Student_Course_System\Form1.Designer.cs
?????文件???????5817??2016-05-27?15:06??學生成績管理系統\Student_Course_System\Student_Course_System\Form1.resx
?????文件??????10658??2016-05-28?16:16??學生成績管理系統\Student_Course_System\Student_Course_System\Form2.cs
?????文件??????17481??2016-05-28?11:52??學生成績管理系統\Student_Course_System\Student_Course_System\Form2.Designer.cs
?????文件???????5817??2016-05-28?16:16??學生成績管理系統\Student_Course_System\Student_Course_System\Form2.resx
?????文件???????2434??2016-05-28?15:26??學生成績管理系統\Student_Course_System\Student_Course_System\Form3.cs
?????文件???????8117??2016-05-27?18:05??學生成績管理系統\Student_Course_System\Student_Course_System\Form3.Designer.cs
?????文件???????6020??2016-05-27?18:05??學生成績管理系統\Student_Course_System\Student_Course_System\Form3.resx
?????文件???????3338??2016-05-28?15:35??學生成績管理系統\Student_Course_System\Student_Course_System\Form4.cs
?????文件???????8913??2016-05-27?18:39??學生成績管理系統\Student_Course_System\Student_Course_System\Form4.Designer.cs
?????文件???????5817??2016-05-27?18:39??學生成績管理系統\Student_Course_System\Student_Course_System\Form4.resx
?????文件???????3547??2016-05-28?16:30??學生成績管理系統\Student_Course_System\Student_Course_System\Form5.cs
?????文件???????7782??2016-05-28?15:07??學生成績管理系統\Student_Course_System\Student_Course_System\Form5.Designer.cs
?????文件???????5817??2016-05-28?15:07??學生成績管理系統\Student_Course_System\Student_Course_System\Form5.resx
?????文件???????2799??2016-05-28?15:26??學生成績管理系統\Student_Course_System\Student_Course_System\Form6.cs
?????文件???????4777??2016-05-28?11:52??學生成績管理系統\Student_Course_System\Student_Course_System\Form6.Designer.cs
?????文件???????5817??2016-05-28?11:52??學生成績管理系統\Student_Course_System\Student_Course_System\Form6.resx
?????文件???????4469??2016-05-28?16:59??學生成績管理系統\Student_Course_System\Student_Course_System\Form7.cs
?????文件??????15727??2016-05-28?16:55??學生成績管理系統\Student_Course_System\Student_Course_System\Form7.Designer.cs
?????文件???????5817??2016-05-28?16:55??學生成績管理系統\Student_Course_System\Student_Course_System\Form7.resx
?????文件???????2741??2016-05-28?16:39??學生成績管理系統\Student_Course_System\Student_Course_System\Form8.cs
?????文件???????8902??2016-05-28?16:35??學生成績管理系統\Student_Course_System\Student_Course_System\Form8.Designer.cs
?????文件???????5817??2016-05-28?16:35??學生成績管理系統\Student_Course_System\Student_Course_System\Form8.resx
............此處省略44個文件信息
評論
共有 條評論