• 大小: 1.12MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-01
  • 语言: C#
  • 标签: winform  

资源简介

.net在线考试系统完整项目 附带数据库(SQL Server Management Studio)(包括教师端和学生端)

资源截图

代码片段和文件信息

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.IO;


namespace ExamOnline
{
//该源码下载自www.51aspx.com(51aspx.com)

    /// 
    /// AutoExercise 的摘要说明:在线练习--自动组卷的功能实现
    /// 

    public class AutoExercise
    {
        string strcon = ““;   //连接字符串

        /// 
        /// 构造函数,连接字符串
        /// 

        public AutoExercise()   
        {
            if (strcon == ““)
            {
                if (HttpContext.Current.Application[“strcon“] == null)
                {
                    string path = HttpContext.Current.Request.PhysicalApplicationPath + “DBSet.ini“;//获取文件物理路径
                    StreamReader sr = new StreamReader(path System.Text.Encoding.Default);
                    strcon = sr.ReadLine();//读取文件内容
                    HttpContext.Current.Application[“strcon“] = strcon;
                }
                else
                {
                    strcon = HttpContext.Current.Application[“strcon“].ToString();
                }
            }
        }

        /// 
        /// 用SQL语句绑定GridView
        /// 

        /// 要绑定的GridView
        /// SQL语句
        public void bindGV(GridView gv string strcmd)
        {
            SqlDataSource sqlds = new SqlDataSource();
            sqlds.ConnectionString = strcon;
            sqlds.SelectCommandType = SqlDataSourceCommandType.Text;
            sqlds.SelectCommand = strcmd;
            gv.DataSource = sqlds;
            gv.DataBind();
        }

        /// 
        /// 取得一门课程某题型难度的最大值
        /// 

        /// 
        /// 
        /// 
        public int getQlevel(string cid int sid)
        {
            SqlConnection con = new SqlConnection(strcon);
            string strcmd = “select max(qlevel) from questions where cid=‘“ + cid + “‘ and sid=‘“ + sid + “‘“;
            SqlCommand cmd = new SqlCommand(strcmd con);
            con.Open();
            int heighLevel =Convert.ToInt32(cmd.ExecuteScalar());
            con.Close();
            return heighLevel;
        }

        /// 
        /// 取得一门课程某题型的总题量
        /// 

        /// 
        /// 
        /// 
        public int getQNum(string cid int sid)
        {
            SqlConnection con = new SqlConnection(strcon);
            string strcmd = “select count(*) from questions where cid=‘“ + cid + “‘ and sid=‘“ + sid + “‘“;
            SqlCommand cmd = new SqlCommand(strcmd con);
            con.Open();
            int qNum =

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-09-25 16:51  在线考试系统\
     文件        2573  2007-05-21 14:00  在线考试系统\51aspx源码必读.txt
     目录           0  2007-05-21 14:00  在线考试系统\App_Code\
     文件        2581  2007-05-21 13:59  在线考试系统\App_Code\51aspx源码必读.txt
     文件       12196  2007-05-21 13:56  在线考试系统\App_Code\AutoExercise.cs
     文件        1170  2007-05-14 00:14  在线考试系统\App_Code\Common.cs
     文件       17551  2007-05-21 13:56  在线考试系统\App_Code\Exam.cs
     文件         773  2007-04-08 14:00  在线考试系统\App_Code\examEnum.cs
     文件        7778  2007-05-20 13:35  在线考试系统\App_Code\login.cs
     文件         125  2007-03-27 14:33  在线考试系统\App_Code\最新Asp.Net源码下载.url
     目录           0  2007-05-21 12:52  在线考试系统\App_Data\
     目录           0  2007-05-21 13:42  在线考试系统\Bin\
     文件      699176  2007-03-28 17:18  在线考试系统\Bin\System.Web.Extensions.DLL
     文件          85  2007-05-21 12:56  在线考试系统\DBSet.ini
     目录           0  2007-05-21 12:54  在线考试系统\DB_51aspx\
     文件     1310720  2007-05-21 13:59  在线考试系统\DB_51aspx\ExamOnline_Data.MDF
     文件     1835008  2007-05-21 13:59  在线考试系统\DB_51aspx\ExamOnline_Log.LDF
     文件        1484  2007-05-09 13:01  在线考试系统\ExamOnline.sln
     目录           0  2007-05-21 12:52  在线考试系统\Images\
     文件        6467  2006-12-06 08:05  在线考试系统\Images\loader.gif
     目录           0  2007-05-21 12:52  在线考试系统\JS\
     文件        1714  2007-05-05 12:06  在线考试系统\JS\antiCommon.js
     目录           0  2007-05-21 14:00  在线考试系统\Students\
     文件        2581  2007-05-21 13:59  在线考试系统\Students\51aspx源码必读.txt
     文件        4781  2007-05-16 21:28  在线考试系统\Students\autoexercise.aspx
     文件        7353  2007-05-15 00:09  在线考试系统\Students\autoexercise.aspx.cs
     文件        2135  2007-05-16 22:11  在线考试系统\Students\autopage.aspx
     文件        7410  2007-05-17 19:58  在线考试系统\Students\autopage.aspx.cs
     文件         580  2007-04-28 14:19  在线考试系统\Students\end.htm
     文件        1333  2007-04-28 14:29  在线考试系统\Students\examlogin.aspx
     文件         715  2007-05-09 13:02  在线考试系统\Students\examlogin.aspx.cs
............此处省略33个文件信息

评论

共有 条评论