资源简介
用C# ADO。NET编写的在线考试系统

代码片段和文件信息
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 MySchool
{
///
/// 增加试题窗体
///
public partial class AddQuestion : Form
{
int difficulty = 0; //难度
int subjectId = 0; //科目编号
string answer = ““; //答案
public AddQuestion()
{
InitializeComponent();
}
//提示用户选择的答案
public void rdoAnswer_Click(object sender EventArgs e)
{
//将sender转换为单选按钮,并获取选中的单选按钮的值
string answer = ((RadioButton)sender).Text;
MessageBox.Show(“你选择了答案“ + answer “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
}
//提示用户选择的难度
public void rdoDifficulty_Click(object sender EventArgs e)
{
string answer = ((RadioButton)sender).Text;
MessageBox.Show(“你选择了难度“ + answer “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
}
private void AddQuestionExit_Click(object sender EventArgs e)
{
this.Close();
}
//窗体加载时将科目载入科目组合框中
public void 增加试题_Load(object sender EventArgs e)
{
//查询科目的SQL语句
string sql = “SELECT SubjectName FROM Subject“;
SqlConnection conn = new SqlConnection();
SqlConnectionStringBuilder connbuilder = new SqlConnectionStringBuilder();
connbuilder.DataSource = @“.\SQLEXPRESS“;
connbuilder.InitialCatalog = “MySchool“;
connbuilder.IntegratedSecurity = true;
conn.ConnectionString = connbuilder.ConnectionString;
try
{
SqlCommand command = new SqlCommand(sqlconn);
conn.Open();
SqlDataReader dataReader = command.ExecuteReader();
while (dataReader.Read())
{
cboSubject.Items.Add(dataReader[“SubjectName“].ToString());
}
dataReader.Close();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
conn.Close();
}
}
//输入验证
public bool ValidateInput()
{
if (txtQuestion.Text == ““)
{
MessageBox.Show(“请输入问题!“);
txtQuestion.Focus();
return false;
}
else if (txtOptionA.Text == ““)
{
MessageBox.Show(“请输入答案A“);
txtOptionA.Focus();
return false;
}
else if (txtOptionB.Text == ““)
{
MessageBox.Show(“请输入答案B“);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-12-22 14:26 考试管理系统\
文件 200178 2013-12-17 23:19 考试管理系统\MySchool.sql
目录 0 2013-12-22 14:26 考试管理系统\WindowsFormsApplication1\
文件 930 2009-10-26 18:57 考试管理系统\WindowsFormsApplication1\MySchool.sln
文件 158720 2014-01-06 23:41 考试管理系统\WindowsFormsApplication1\MySchool.suo
目录 0 2013-12-22 14:26 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\
文件 24528 2009-11-07 13:37 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddQuestion.Designer.cs
文件 8831 2013-11-29 23:03 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddQuestion.cs
文件 17946 2009-11-07 13:37 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddQuestion.resx
文件 18466 2013-12-05 20:52 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddStudentForm.Designer.cs
文件 11327 2013-12-17 22:54 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddStudentForm.cs
文件 17946 2013-12-05 20:52 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddStudentForm.resx
文件 13718 2013-12-05 22:25 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddTeacherForm.Designer.cs
文件 4323 2013-12-17 23:00 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddTeacherForm.cs
文件 5817 2013-12-05 22:25 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AddTeacherForm.resx
文件 30121 2009-11-07 14:22 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AnswerCard.Designer.cs
文件 2958 2013-11-30 11:36 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AnswerCard.cs
文件 18145 2009-11-07 14:22 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AnswerCard.resx
文件 9339 2009-11-07 13:44 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AnswerQuestionForm.Designer.cs
文件 5955 2013-11-30 11:36 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AnswerQuestionForm.cs
文件 18145 2009-11-07 13:44 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\AnswerQuestionForm.resx
文件 1 2009-10-12 19:55 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\ClassDiagram1.cd
文件 1 2009-10-26 19:14 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\ClassDiagram2.cd
文件 429 2009-10-30 17:52 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\ClassDiagram3.cd
文件 24592 2009-11-07 13:45 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\DetailsQuestions.Designer.cs
文件 10220 2013-11-29 23:07 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\DetailsQuestions.cs
文件 17946 2009-11-07 13:45 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\DetailsQuestions.resx
文件 13256 2013-12-17 22:55 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\EditStudentForm.cs
文件 31396 2013-12-05 22:00 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\EditStudentForm.designer.cs
文件 5814 2013-12-05 22:00 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\EditStudentForm.resx
文件 6097 2013-12-05 22:26 考试管理系统\WindowsFormsApplication1\WindowsFormsApplication1\EditTeacherForm.cs
............此处省略212个文件信息
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
评论
共有 条评论