资源简介
C# 项目案例设计 适用于c#初学者,简单易懂,注释详细
带数据库
![](http://www.nz998.com/pic/64136.jpg)
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace question
{
public partial class checkForm : Form
{
public checkForm()
{
InitializeComponent();
}
public int counts;
public string[] answer=new string[20];
public string[] trueAnswer = new string[20];
public int index;
private void checkForm_Load(object sender EventArgs e)
{
btnInfo();
checkAnswer();
}
private void btnInfo() {
int x = 20; int y = 20;
for (int i = 1; i <= counts;i++ )
{
Button btn = new Button();
btn.Size = new Size(6060);
btn.Location = new Point(xy);
btn.Name = i.ToString();
btn.Text = i + “.“ + “未回答“;
btn.Tag = i;
x += 70;
if(i%5==0){
x = 20;
y += 70;
}
btn.Click += new EventHandler(btn_Click);
groupBox1.Controls.Add(btn);
}
}
void btn_Click(object sender EventArgs e)
{
Button btn = (Button)sender;
index = Convert.ToInt32(btn.Tag)-1;
this.Close();
}
private void checkAnswer() {
int i=0;
foreach(Control cn in groupBox1.Controls ){
Button btn = (Button)cn;
if(answer[i]!=null){
btn.Text = (i + 1) + “.“ + answer[i];
}
i++;
}
}
private int chkAnswer() {
int count = 100;
for (int i = 0; i < counts;i++ )
{
if (answer[i] != trueAnswer[i])
{
count -= 5;
}
}
return count;
}
private void btnJiaoJuan_Click(object sender EventArgs e)
{
int i = chkAnswer();
DialogResult result = MessageBox.Show(“您的得分为“ + i + “分“ + “||“ + “按确定退出考试系统“);
if(result==DialogResult.OK){
Environment.Exit(0);
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 913 2009-01-15 15:28 question\question.sln
..A..H. 19968 2009-03-19 09:53 question\question.suo
文件 5612 2009-01-15 15:24 question\question\Properties\Resources.resx
文件 249 2009-01-15 15:24 question\question\Properties\Settings.settings
文件 1176 2009-01-15 15:24 question\question\Properties\AssemblyInfo.cs
文件 2870 2009-01-15 15:24 question\question\Properties\Resources.Designer.cs
文件 1091 2009-01-15 15:24 question\question\Properties\Settings.Designer.cs
文件 7323 2009-01-16 15:01 question\question\questionForm.cs
文件 17399 2009-01-16 10:37 question\question\questionForm.Designer.cs
文件 4021 2009-01-15 20:13 question\question\question.csproj
文件 5632 2005-11-11 22:25 question\question\bin\Debug\question.vshost.exe
文件 53248 2009-03-18 14:37 question\question\bin\Debug\question.exe
文件 44544 2009-03-18 14:37 question\question\bin\Debug\question.pdb
文件 180 2009-01-15 15:28 question\question\obj\Debug\question.Properties.Resources.resources
文件 10700 2009-01-16 10:37 question\question\obj\Debug\question.questionForm.resources
文件 10700 2009-01-16 12:22 question\question\obj\Debug\question.selectQuestionForm.resources
文件 53248 2009-03-18 14:37 question\question\obj\Debug\question.exe
文件 180 2009-01-16 12:22 question\question\obj\Debug\question.checkForm.resources
文件 1121 2009-01-16 12:22 question\question\obj\Debug\question.csproj.GenerateResource.Cache
文件 44544 2009-03-18 14:37 question\question\obj\Debug\question.pdb
文件 371 2009-03-18 14:37 question\question\obj\question.csproj.FileList.txt
文件 21312 2009-01-16 10:37 question\question\questionForm.resx
文件 2669 2009-01-16 12:22 question\question\checkForm.Designer.cs
文件 1394 2009-01-16 12:22 question\question\selectQuestionForm.cs
文件 5814 2009-01-16 12:22 question\question\checkForm.resx
文件 2480 2009-01-16 12:22 question\question\checkForm.cs
文件 2931 2009-01-16 12:22 question\question\selectQuestionForm.Designer.cs
文件 21312 2009-01-16 12:22 question\question\selectQuestionForm.resx
文件 480 2009-01-15 15:47 question\question\Program.cs
文件 249 2009-01-15 15:48 question\question\question.csproj.user
............此处省略15个文件信息
相关资源
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 020ASP.NET车辆综合管理系统.zip
- 智慧城市 智能家居 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#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
评论
共有 条评论