基于C#和Mysql的学生信息管理系统,运行.sln文件即可。
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-07-09 17:27 PWMS
目录 0 2016-07-09 17:27 PWMSDatabase
文件 3145728 2012-04-20 14:30 PWMSDatabasedb_PWMS.mdf
文件 2359296 2012-04-20 14:30 PWMSDatabasedb_PWMS_log.ldf
目录 0 2016-07-09 17:27 PWMSDataClass
文件 4452 2012-04-20 13:54 PWMSDataClassMyMeans.cs
文件 3016 2008-03-21 11:00 PWMSF_Login.cs
文件 6856 2008-03-11 19:09 PWMSF_Login.designer.cs
文件 341697 2008-03-11 19:09 PWMSF_Login.resx
文件 7226 2008-03-21 18:43 PWMSF_Main.cs
文件 38268 2008-03-21 14:36 PWMSF_Main.designer.cs
文件 1001373 2008-03-21 14:36 PWMSF_Main.resx
目录 0 2016-07-09 17:27 PWMSImage
文件 2909 2008-02-25 16:06 PWMSImage 1.png
文件 3077 2008-02-25 16:06 PWMSImage 2.PNG
文件 3241 2008-02-25 16:05 PWMSImage 3.PNG
文件 2897 2008-02-25 16:05 PWMSImage 4.PNG
文件 3092 2008-02-25 16:05 PWMSImage 5.PNG
文件 3525 2008-02-25 16:05 PWMSImage 6.PNG
文件 2933 2008-02-25 16:04 PWMSImage 7.PNG
文件 3636 2008-02-25 15:53 PWMSImage 8.PNG
文件 3042 2008-02-25 15:51 PWMSImage 9.PNG
文件 29776 2007-12-11 22:05 PWMSImagePEOPLE.jpg
文件 659936 2008-02-25 15:44 PWMSImage主界面.bmp
文件 1804 2008-02-25 16:08 PWMSImage备份.bmp
文件 223716 2008-02-25 15:44 PWMSImage登录.BMP
目录 0 2016-07-09 17:27 PWMSInfoAddForm
文件 11367 2008-03-11 19:14 PWMSInfoAddFormF_Address.Designer.cs
文件 2354 2008-03-26 14:26 PWMSInfoAddFormF_Address.cs
文件 5814 2008-03-11 19:14 PWMSInfoAddFormF_Address.resx
文件 8024 2008-03-11 19:14 PWMSInfoAddFormF_Basic.Designer.cs
............此处省略100个文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace PWMS
{
public partial class F_Login : Form
{
DataClass.MyMeans MyClass = new PWMS.DataClass.MyMeans();
public F_Login()
{
InitializeComponent();
}
private void butClose_Click(object sender EventArgs e)
{
if ((int)(this.Tag) == 1)
{
DataClass.MyMeans.Login_n = 3;
Application.Exit();
}
else
if ((int)(this.Tag) == 2)
this.Close();
}
private void butLogin_Click(object sender EventArgs e)
{
if (textName.Text != ““ & textPass.Text != ““)
{
SqlDataReader temDR = MyClass.getcom(“select * from tb_Login where Name=‘“ + textName.Text.Trim() + “‘ and Pass=‘“ + textPass.Text.Trim() + “‘“);
bool ifcom = temDR.Read();
if (ifcom)
{
DataClass.MyMeans.Login_Name = textName.Text.Trim();
DataClass.MyMeans.Login_ID = temDR.GetString(0);
DataClass.MyMeans.My_con.Close();
DataClass.MyMeans.My_con.Dispose();
DataClass.MyMeans.Login_n = (int)(this.Tag);
this.Close();
}
else
{
MessageBox.Show(“用户名或密码错误!“ “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
textName.Text = ““;
textPass.Text = ““;
}
MyClass.con_close();
}
else
MessageBox.Show(“请将登录信息添写完整!“ “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
}
private void F_Login_Load(object sender EventArgs e)
{
try
{
MyClass.con_open(); //连接数据库
MyClass.con_close();
textName.Text = ““;
textPass.Text = ““;
}
catch
{
MessageBox.Show(“数据库连接失败。“ “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
Application.Exit();
}
}
private void textName_KeyPress(object sender KeyPressEventArgs e)
{
if (e.KeyChar == ‘
‘)
textPass.Focus();
}
private void textPass_KeyPress(object sender KeyPressEventArgs e)
{
if (e.KeyChar == ‘
‘)
butLogin.Focus();
}
private void F_Login_Activated(object sender EventArgs e)
{
textName.Focus();
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-07-09 17:27 PWMS
目录 0 2016-07-09 17:27 PWMSDataba
文件 3145728 2012-04-20 14:30 PWMSDataba
文件 2359296 2012-04-20 14:30 PWMSDataba
目录 0 2016-07-09 17:27 PWMSDataClass
文件 4452 2012-04-20 13:54 PWMSDataClassMyMeans.cs
文件 3016 2008-03-21 11:00 PWMSF_Login.cs
文件 6856 2008-03-11 19:09 PWMSF_Login.designer.cs
文件 341697 2008-03-11 19:09 PWMSF_Login.resx
文件 7226 2008-03-21 18:43 PWMSF_Main.cs
文件 38268 2008-03-21 14:36 PWMSF_Main.designer.cs
文件 1001373 2008-03-21 14:36 PWMSF_Main.resx
目录 0 2016-07-09 17:27 PWMSImage
文件 2909 2008-02-25 16:06 PWMSImage 1.png
文件 3077 2008-02-25 16:06 PWMSImage 2.PNG
文件 3241 2008-02-25 16:05 PWMSImage 3.PNG
文件 2897 2008-02-25 16:05 PWMSImage 4.PNG
文件 3092 2008-02-25 16:05 PWMSImage 5.PNG
文件 3525 2008-02-25 16:05 PWMSImage 6.PNG
文件 2933 2008-02-25 16:04 PWMSImage 7.PNG
文件 3636 2008-02-25 15:53 PWMSImage 8.PNG
文件 3042 2008-02-25 15:51 PWMSImage 9.PNG
文件 29776 2007-12-11 22:05 PWMSImagePEOPLE.jpg
文件 659936 2008-02-25 15:44 PWMSImage主界面.bmp
文件 1804 2008-02-25 16:08 PWMSImage备份.bmp
文件 223716 2008-02-25 15:44 PWMSImage登录.BMP
目录 0 2016-07-09 17:27 PWMSInfoAddForm
文件 11367 2008-03-11 19:14 PWMSInfoAddFormF_Address.Designer.cs
文件 2354 2008-03-26 14:26 PWMSInfoAddFormF_Address.cs
文件 5814 2008-03-11 19:14 PWMSInfoAddFormF_Address.resx
文件 8024 2008-03-11 19:14 PWMSInfoAddFormF_Basic.Designer.cs
............此处省略100个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)