• 大小: 648KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-23
  • 语言: C#
  • 标签: C#  

资源简介

c#编写的简单考试系统

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;

namespace 单选题
{
    class ctimu
    {
        string question answer myanswer;
        bool isdone;
        int score;
        public ctimu(string q string a)
        {
            question = q;
            answer = a;
            myanswer = ““;
            isdone = false;
            score = 0;

        }
        public void   dotimu(string an)
        {
            myanswer = an;
            isdone = true;
        }
        public void pingfen()
        {
            if (myanswer ==answer )
            {
                score = 10;
            }
        }
        public int getscore()
        {
            return score;
        }
        public bool getisdone()
        {
            return isdone;
        }
        public static OleDbConnection DBconnection()//定义Connection对象
        {
            return new OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0; Data Source=db1.mdb“);
        }
        public static DataTable select(string sql_sele)
        {
            OleDbConnection con = ctimu.DBconnection();
            con.Open();
            OleDbCommand com = new OleDbCommand(sql_sele con);
            DataSet ds = new DataSet();
            OleDbDataAdapter adpter = new OleDbDataAdapter();
            adpter.SelectCommand = com;
            adpter.Fill(ds);
            con.Close();
            return ds.Tables[0];
        }
        public static string SelOne(string sql)//返回记录为一个值
        {
            OleDbConnection con = ctimu.DBconnection();
            con.Open();
            OleDbCommand com = new OleDbCommand(sql con);
            return com.ExecuteScalar().ToString();
            con.Close();
        }
    }
}

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

     文件        916  2007-10-12 09:55  单选题\单选题.sln

    ..A..H.     27136  2008-05-10 16:45  单选题\单选题.suo

     文件       1871  2008-02-11 15:44  单选题\单选题\ctimu.cs

     文件      11730  2008-01-10 16:32  单选题\单选题\Form1.cs

     文件      14898  2008-01-10 16:31  单选题\单选题\Form1.Designer.cs

     文件       6008  2008-01-10 16:31  单选题\单选题\Form1.resx

     文件        553  2004-12-02 10:59  单选题\单选题\Form2.cs

     文件       5089  2004-12-02 10:59  单选题\单选题\Form2.Designer.cs

     文件       5814  2004-12-02 10:59  单选题\单选题\Form2.resx

     文件        469  2008-01-06 17:37  单选题\单选题\Program.cs

     文件       3944  2008-01-08 21:15  单选题\单选题\单选题.csproj

     文件       2418  2008-02-11 15:43  单选题\单选题\登陆.cs

     文件       5368  2008-02-11 14:36  单选题\单选题\登陆.Designer.cs

     文件    1243875  2008-02-11 14:36  单选题\单选题\登陆.resx

     文件       1202  2007-10-12 09:55  单选题\单选题\Properties\AssemblyInfo.cs

     文件       2872  2007-10-12 09:55  单选题\单选题\Properties\Resources.Designer.cs

     文件       5612  2007-10-12 09:55  单选题\单选题\Properties\Resources.resx

     文件       1092  2007-10-12 09:55  单选题\单选题\Properties\Settings.Designer.cs

     文件        249  2007-10-12 09:55  单选题\单选题\Properties\Settings.settings

     文件        357  2008-03-25 11:45  单选题\单选题\obj\单选题.csproj.FileList.txt

     文件        959  2008-01-10 16:31  单选题\单选题\obj\Debug\单选题.csproj.GenerateResource.Cache

     文件     860160  2008-01-10 16:32  单选题\单选题\obj\Debug\单选题.exe

     文件        180  2008-01-10 16:31  单选题\单选题\obj\Debug\单选题.Form1.resources

     文件        180  2008-01-09 10:09  单选题\单选题\obj\Debug\单选题.Form2.resources

     文件      62976  2008-01-10 16:32  单选题\单选题\obj\Debug\单选题.pdb

     文件        180  2008-01-09 10:09  单选题\单选题\obj\Debug\单选题.Properties.Resources.resources

     文件     825864  2008-01-10 16:32  单选题\单选题\obj\Debug\单选题.登陆.resources

     文件        122  2008-05-10 15:05  单选题\单选题\obj\单选题.csproj.FileListAbsolute.txt

     文件     307200  2008-01-06 21:36  单选题\单选题\bin\Debug\db1.mdb

     文件     860160  2008-01-10 16:32  单选题\单选题\bin\Debug\单选题.exe

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

评论

共有 条评论