开发工具:
文件大小: 57kb
下载次数: 0
上传时间: 2013-06-27
详细说明: 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 System.Data.SqlClient; namespace 学生管理系统 { public partial class 登陆 : Form { int MyField; public 登陆() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //string source = "server= LLTS-20110105UW"+" inte grated security=SSPI "+"database=library"; string source = "Data Source=;Initial Catalog=library;Integrated Security=True"; SqlConnection conn = new SqlConnection(source); try { conn = new SqlConnection(source); string selectStr = "select LoginName,Password from denglu where LoginName=" + "'" + textBox1.Text.Trim() + "'" + " and Password=" + "'" + textBox2.Text.Trim() + "'"+"and identity="+"'"+"and identity="+"'";//+ +"'"; SqlCommand Command = new SqlCommand(selectStr, conn); conn.Open(); SqlDataReader sqlread = Command.ExecuteReader(CommandBehavior.CloseConnection); sqlread.Read(); if (sqlread.HasRows) { if (MyField == 1) { //this.Hide(); Form a = new 学生界面(); a.Show(); } else if (MyField ==2) { Form Form = new 教师界面(); Form.Show(); this.Hide(); } } else { MessageBox.Show("用户名或者密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); textBox1.Text = ""; textBox2.Text = ""; textBox1.Focus(); } sqlread.Close(); } catch (Exception sqlException) { MessageBox.Show("连接错误" + sqlException.ToString()); } } private void button2_Click(object sender, EventArgs e) { this.Close(); } private void radioButton1_CheckedChanged(object sender, EventArgs e) { MyField = 2; } private void radioButton2_CheckedChanged(object sender, EventArgs e) { MyField = 1; } } } ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.