• 大小: 288KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: C#
  • 标签: 教学  平台  c#  asp.net  

资源简介

自己写的,asp.net实现的网络教学平台,多多提意见,希望对C#及asp.net的学习有所帮助 本系统采用sql2005+asp.net编写

资源截图

代码片段和文件信息

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.xml.Linq;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            this.txtUserId.Text =““ ;
            this.txtUserPwd.Text = ““;

        }
    }
    protected void btnLogin_Click(object sender EventArgs e)
    {
        string userId=Request.Form[“txtUserId“];
        string userPwd=Request.Form[“txtUserPwd“];
        SqlConnection con = DB.createConnection();
        con.Open();

        if (this.rbAdmin.Checked)
        {

            SqlCommand cmd = new SqlCommand(“select count(*) from admin where mid=‘“ + userId + “ ‘and passwd=‘“ + userPwd + “ ‘“ con);
            int count = Convert.ToInt32(cmd.ExecuteScalar());
            if (count > 0)
            {
                Session[“mid“] = userId;
                Response.Redirect(“admin\\index.aspx“);
            }
            else
            {
                Response.Redirect(“loginFailed.htm“);
            }
        }
        else
        {
            if (this.rbStudent.Checked)
            {
                SqlCommand cmd = new SqlCommand(“select count(*) from user_s where sid=‘“ + userId + “ ‘and passwd=‘“ + userPwd + “ ‘“ con);
                int count = Convert.ToInt32(cmd.ExecuteScalar());
                if (count > 0)
                {
                    Session[“sid“] = userId;
                    Response.Redirect(“student\\index.aspx“);
                }
                else
                {
                    Response.Redirect(“loginFailed.htm“);
                }
            }
            else
            {
                if (this.rbTeacher.Checked)
                {
                    SqlCommand cmd = new SqlCommand(“select count(*) from user_t where tid=‘“ + userId + “ ‘and passwd=‘“ + userPwd + “ ‘“ con);
                    int count = Convert.ToInt32(cmd.ExecuteScalar());
                    if (count > 0)
                    {
                        Session[“tid“] = userId;
                        Response.Redirect(“teacher\\index.aspx“);
                    }
                    else
                    {
                        Response.Redirect(“loginFailed.htm“);
                    }
                }
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1931  2009-07-16 11:18  teaching_platform\admin\addCourse.aspx

     文件       4650  2009-07-16 11:18  teaching_platform\admin\addCourse.aspx.cs

     文件       2244  2009-07-16 11:18  teaching_platform\admin\addStudent.aspx

     文件       2532  2009-07-16 11:18  teaching_platform\admin\addStudent.aspx.cs

     文件       1947  2009-07-16 11:18  teaching_platform\admin\addTeacher.aspx

     文件       4711  2009-07-16 11:18  teaching_platform\admin\addTeacher.aspx.cs

     文件       1067  2009-07-16 11:18  teaching_platform\admin\index.aspx

     文件       1618  2009-07-16 11:18  teaching_platform\admin\index.aspx.cs

     文件        865  2009-07-16 11:18  teaching_platform\App_Code\DB.cs

     文件        496  2009-07-16 11:18  teaching_platform\App_Code\Student.cs

     文件       3527  2009-07-16 11:18  teaching_platform\App_Code\studentOperate.cs

     文件    2293760  2009-07-16 09:36  teaching_platform\App_Data\teaching.mdf

     文件     573440  2009-07-16 09:36  teaching_platform\App_Data\teaching_Log.ldf

     文件       3402  2009-07-16 11:18  teaching_platform\BLL\admin.cs

     文件       3367  2009-07-16 11:18  teaching_platform\BLL\course.cs

     文件       3529  2009-07-16 11:18  teaching_platform\BLL\coursefile.cs

     文件       3770  2009-07-16 11:18  teaching_platform\BLL\courseinter.cs

     文件       3529  2009-07-16 11:18  teaching_platform\BLL\courselink.cs

     文件       3724  2009-07-16 11:18  teaching_platform\BLL\course_student.cs

     文件       3549  2009-07-16 11:18  teaching_platform\BLL\course_teacher.cs

     文件       3310  2009-07-16 11:18  teaching_platform\BLL\users.cs

     文件       3419  2009-07-16 11:18  teaching_platform\BLL\user_s.cs

     文件       3419  2009-07-16 11:18  teaching_platform\BLL\user_t.cs

     文件       5582  2009-07-16 11:18  teaching_platform\DAL\admin.cs

     文件       5270  2009-07-16 11:18  teaching_platform\DAL\course.cs

     文件       5917  2009-07-16 11:18  teaching_platform\DAL\coursefile.cs

     文件       6934  2009-07-16 11:18  teaching_platform\DAL\courseinter.cs

     文件       5917  2009-07-16 11:18  teaching_platform\DAL\courselink.cs

     文件       6388  2009-07-16 11:18  teaching_platform\DAL\course_student.cs

     文件       5696  2009-07-16 11:18  teaching_platform\DAL\course_teacher.cs

............此处省略81个文件信息

评论

共有 条评论