资源简介
教学管理系统 ASP.NET(含数据库),课程设计可参考。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class 登录界面 : System.Web.UI.Page
{
protected void Page_Load(object sender EventArgs e)
{
}
protected void Button1_Click(object sender EventArgs e)
{
string Username = ““;
string userscode = ““;
string Userscode = TextBox1.Text;
string Password = TextBox2.Text;
string Usertype = DropDownList1.Text;
SqlConnection conn = new SqlConnection();
conn.ConnectionString = “User ID=sa;Initial Catalog=StudDB;Data Source= (local);Password=123456“;
// 打开连接
if (conn.State == ConnectionState.Closed)
{
conn.Open();
}
// 初始化命令
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
if (Usertype == “管理员“)
{
cmd.CommandText = String.Format(“select * from manager where mno = ‘{0}‘ and mpass = ‘{1}‘ “ Userscode Password);
userscode = String.Format(“ select mname from manager where mno = ‘{0}‘“ Userscode);
}
else if (Usertype == “学生“)
{
cmd.CommandText = String.Format(“select * from student where sno = ‘{0}‘ and spass = ‘{1}‘ “ Userscode Password);
userscode = String.Format(“ select sname from student where sno = ‘{0}‘“ Userscode);
}
else if(Usertype == “教师“)
{
cmd.CommandText = String.Format(“select * from teacher where tno = ‘{0}‘ and tpass = ‘{1}‘ “ Userscode Password);
userscode = String.Format(“ select tname from teacher where tno = ‘{0}‘“ Userscode);
}
//int i = cmd.ExecuteNonQuery();
SqlDataReader logintest = cmd.ExecuteReader();
if (logintest.HasRows)
{
Response.Write(“ript>alert(‘登录成功!‘) ript>“);
}
else
{
Response.Write(“ript>alert(‘登录失败!请检查用户名是否正确‘) ript>“);
}
logintest.Close();
conn.Close();
cmd.CommandText = userscode;
conn.Open();
Username = cmd.ExecuteScalar().ToString();
Session[“username“] = Username;
Session[“usertype“] = Usertype;
Session[“usercode“] = Userscode;
Response.Redirect(“MainPage.aspx“);
if (conn.State == ConnectionState.Open) //判断数据库连接状态,是否连接
{
conn.Close();
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 27648 2017-02-23 15:27 教学管理系统 ASP.NET\ScoreAdmin.suo
文件 1194 2017-07-11 12:23 教学管理系统 ASP.NET\教学管理系统\App_Code\DB.cs
文件 2311 2017-07-11 12:32 教学管理系统 ASP.NET\教学管理系统\Login.aspx
文件 2770 2017-06-27 09:28 教学管理系统 ASP.NET\教学管理系统\Login.aspx.cs
文件 3852 2017-06-26 21:27 教学管理系统 ASP.NET\教学管理系统\MainPage.aspx
文件 2540 2017-06-27 09:17 教学管理系统 ASP.NET\教学管理系统\MainPage.aspx.cs
文件 3637 2017-06-16 16:10 教学管理系统 ASP.NET\教学管理系统\Manager\UsersManage.aspx
文件 2441 2017-07-11 12:23 教学管理系统 ASP.NET\教学管理系统\Manager\UsersManage.aspx.cs
文件 2848 2017-06-26 20:56 教学管理系统 ASP.NET\教学管理系统\Student\StudentCheckScore.aspx
文件 1050 2017-07-11 12:31 教学管理系统 ASP.NET\教学管理系统\Student\StudentCheckScore.aspx.cs
文件 4629 2017-06-27 08:08 教学管理系统 ASP.NET\教学管理系统\Student\StudentChooseCourse.aspx
文件 1456 2017-07-11 12:30 教学管理系统 ASP.NET\教学管理系统\Student\StudentChooseCourse.aspx.cs
文件 3622 2017-06-16 15:21 教学管理系统 ASP.NET\教学管理系统\Student\StudentUpdatePassword.aspx
文件 983 2017-07-11 12:30 教学管理系统 ASP.NET\教学管理系统\Student\StudentUpdatePassword.aspx.cs
文件 3345 2017-06-26 21:09 教学管理系统 ASP.NET\教学管理系统\Teacher\StudentCheckScore.aspx
文件 1718 2017-07-11 12:29 教学管理系统 ASP.NET\教学管理系统\Teacher\StudentCheckScore.aspx.cs
文件 2884 2017-06-16 14:39 教学管理系统 ASP.NET\教学管理系统\Teacher\StudentCourseInfo.aspx
文件 297 2017-06-07 18:12 教学管理系统 ASP.NET\教学管理系统\Teacher\StudentCourseInfo.aspx.cs
文件 4000 2017-06-26 21:27 教学管理系统 ASP.NET\教学管理系统\Teacher\StudentInfoManage.aspx
文件 1768 2017-07-11 12:29 教学管理系统 ASP.NET\教学管理系统\Teacher\StudentInfoManage.aspx.cs
文件 4328 2017-06-16 15:09 教学管理系统 ASP.NET\教学管理系统\Teacher\StudentScoreUpload.aspx
文件 1936 2017-07-11 12:29 教学管理系统 ASP.NET\教学管理系统\Teacher\StudentScoreUpload.aspx.cs
文件 604 2017-06-16 14:38 教学管理系统 ASP.NET\教学管理系统\Web.config
文件 1306 2017-05-07 21:25 教学管理系统 ASP.NET\教学管理系统\Web.Debug.config
文件 3145728 2017-07-17 22:12 教学管理系统 ASP.NET\教学管理系统 数据库\StudDB.mdf
文件 3211264 2017-07-17 22:12 教学管理系统 ASP.NET\教学管理系统 数据库\StudDB_log.ldf
目录 0 2017-11-10 13:12 教学管理系统 ASP.NET\教学管理系统\App_Code
目录 0 2017-11-10 13:12 教学管理系统 ASP.NET\教学管理系统\Manager
目录 0 2017-11-10 13:12 教学管理系统 ASP.NET\教学管理系统\Student
目录 0 2017-11-10 13:12 教学管理系统 ASP.NET\教学管理系统\Teacher
............此处省略6个文件信息
- 上一篇:C#实现歌词显示.LRC歌词
- 下一篇:基于c#的层次分析法
相关资源
- Asp.net学生信息管理系统源码
- asp.net C#购物车源代码
- ASP.NET实验室预约管理系统
- 020ASP.NET车辆综合管理系统.zip
- c# 高校档案信息管理系统
- asp.net中c#做的躲避小游戏,希望大家
- ASP.NET C# 工资管理系统
- 一款漂亮的灯光闪烁的圣诞树(C# V
- C#笔试题大全C#面试集合包括了,.ne
- ASP.NET客户管理系统(毕业设计 C#
- 在线求职系统(C#ASP.NET源码)
- .NET C# Custom Form Designer (附源碼)
- 医院门诊管理系统 aspc#access数据库
- C#冒泡排序动态演示程序(看了就会)
- 酒店管理系统(c#.net源码)
- asp.net 在线考试系统及论文
- winform实时获取网卡网速全部源码,获
- ASP.Net文件上传管理源码
- ArcGIS Runtime SDK for .NET
- C# .NET5.0(net core)基于WPF(XAML)开发
- Quartz.NET定时任务框架
- .net core 动态生成 Word文档(word Expor
- 《OA企业办公自动化》asp.net 源码(附
- .net 检测新版本-自动升级程序
- tcp和udp(Mina.net)
- asp.netc#开发规范
- ADO.NET操作EXCEL
- asp.net 大文件上传(带进度条)
- 通过程序自动填充并提交ASP.NET表单(
- ASP.NET 基础编程文档(PPT电子教案)
评论
共有 条评论