程序流程图如下: copyright paper51.com 3 本程序的技术实现及具体功能 内容来自www.paper51.com 3.1 登录的界面与程序设计实现 内容来自论文无忧网 www.paper51.com
内容来自论文无忧网 www.paper51.com 代码设计: copyright paper51.com unit kaoshi1; http://www.paper51.com
interface 内容来自www.paper51.com
uses 内容来自www.paper51.com Windows, Messages, SysUtils, Classes,Graphics, Controls, Forms, Dialogs, copyright paper51.com StdCtrls, Db, DBTables, ComCtrls; 内容来自www.paper51.com type http://www.paper51.com TKaoShi1Form = class(TForm) http://www.paper51.com Label1: TLabel; copyright paper51.com Edit1: TEdit; 内容来自论文无忧网 www.paper51.com Button1: TButton; paper51.com Label2: TLabel; http://www.paper51.com
ComboBox1: TComboBox; http://www.paper51.com
Query1: TQuery; copyright paper51.com
Label3: TLabel; http://www.paper51.com shijian:TEdit; 内容来自论文无忧网 www.paper51.com UpDown1: TUpDown; 内容来自论文无忧网 www.paper51.com procedureButton1Click(Sender: TObject); 内容来自论文无忧网 www.paper51.com procedureFormCreate(Sender: TObject); 内容来自www.paper51.com private http://www.paper51.com { Privatedeclarations } copyright paper51.com public copyright paper51.com { Publicdeclarations } copyright paper51.com end; copyright paper51.com var 内容来自论文无忧网 www.paper51.com KaoShi1Form: TKaoShi1Form; 内容来自www.paper51.com implementation http://www.paper51.com usesKaishi,KaoShi2; http://www.paper51.com
{$R *.DFM} 内容来自www.paper51.com procedure TKaoShi1Form.Button1Click(Sender:TObject); http://www.paper51.com begin paper51.com if trim(Edit1.text)='' then 内容来自www.paper51.com begin 内容来自论文无忧网 www.paper51.com
showmessage('请输入姓名'); http://www.paper51.com Edit1.SetFocus; copyright paper51.com end 内容来自论文无忧网 www.paper51.com else http://www.paper51.com begin paper51.com
if MessageDlg('真的要开始考试吗?',mtConfirmation, [mbYes, mbNo], 0) copyright paper51.com = mrYes then http://www.paper51.com
begin http://www.paper51.com KaiShiform.renming:=Edit1.Text; http://www.paper51.com
Application.CreateForm(TKaoshi2Form,Kaoshi2Form); paper51.com KaoShi2Form.Show; 内容来自www.paper51.com KaoShi1Form.Release; http://www.paper51.com end 内容来自论文无忧网 www.paper51.com end; 内容来自论文无忧网 www.paper51.com
end; http://www.paper51.com procedure TKaoShi1Form.FormCreate(Sender: TObject); paper51.com var i:byte; 内容来自论文无忧网 www.paper51.com begin http://www.paper51.com query1.DatabaseName:=kaishiform.AppPath; copyright paper51.com Query1.SQL.Add('Selectzu from 题库.db group by zu'); paper51.com Query1.open; 内容来自论文无忧网 www.paper51.com i:=1; http://www.paper51.com if query1.RecordCount>0 then http://www.paper51.com
begin http://www.paper51.com whilei<=query1.RecordCount do 内容来自论文无忧网 www.paper51.com begin paper51.com combobox1.Items.Add(Query1.fieldbyname('zu').asstring); paper51.com i:=i+1; 内容来自论文无忧网 www.paper51.com query1.RecNo:=i; 内容来自www.paper51.com end; http://www.paper51.com combobox1.Text:=trim(combobox1.Items.Strings[0]); 内容来自论文无忧网 www.paper51.com
end; 内容来自www.paper51.com
end; 内容来自论文无忧网 www.paper51.com
end. paper51.com 3.2 得分界面与代码设计实现 http://www.paper51.com
unit Defen; 内容来自www.paper51.com
interface http://www.paper51.com uses http://www.paper51.com Windows,Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, http://www.paper51.com
StdCtrls; 内容来自www.paper51.com type copyright paper51.com
TDeFenForm = class(TForm) paper51.com Label1: TLabel; 内容来自www.paper51.com Label2: TLabel; 内容来自论文无忧网 www.paper51.com renming: TListBox; http://www.paper51.com defen: TListBox; copyright paper51.com Button1: TButton; copyright paper51.com
procedure FormCreate(Sender: TObject); 内容来自论文无忧网 www.paper51.com procedure Button1Click(Sender: TObject); 内容来自www.paper51.com private 内容来自www.paper51.com
{ Private declarations } http://www.paper51.com public 内容来自www.paper51.com { Public declarations } http://www.paper51.com end; 内容来自论文无忧网 www.paper51.com var copyright paper51.com DeFenForm: TDeFenForm; 内容来自www.paper51.com implementation copyright paper51.com
uses kaishi; 内容来自论文无忧网 www.paper51.com
{$R *.DFM} 内容来自论文无忧网 www.paper51.com procedure TDeFenForm.FormCreate(Sender: TObject); paper51.com begin http://www.paper51.com renming.Items.LoadFromFile(kaishiform.AppPath+'\rm.sav'); http://www.paper51.com defen.Items.LoadFromFile(kaishiform.AppPath+'\df.sav'); copyright paper51.com end; copyright paper51.com procedure TDeFenForm.Button1Click(Sender: TObject); http://www.paper51.com begin 内容来自论文无忧网 www.paper51.com renming.Items.Clear; 内容来自论文无忧网 www.paper51.com defen.Items.Clear; paper51.com renming.Items.SaveToFile(kaishiform.AppPath+'\rm.sav'); copyright paper51.com defen.Items.SaveToFile(kaishiform.AppPath+'\df.sav'); copyright paper51.com end; 内容来自www.paper51.com end. http://www.paper51.com 3.3 关于界面与代码设计实现 内容来自论文无忧网 www.paper51.com
内容来自论文无忧网 www.paper51.com 代码设计: 内容来自论文无忧网 www.paper51.com unit GuanYu; 内容来自www.paper51.com interface paper51.com uses http://www.paper51.com Windows,Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, copyright paper51.com
StdCtrls,Buttons; paper51.com type copyright paper51.com
TGuanYuForm = class(TForm) 内容来自www.paper51.com Label1: TLabel; copyright paper51.com Label3: TLabel; copyright paper51.com Label2: TLabel; 内容来自论文无忧网 www.paper51.com
Label4: TLabel; 内容来自论文无忧网 www.paper51.com Label5: TLabel; 内容来自论文无忧网 www.paper51.com Label8: TLabel; 内容来自论文无忧网 www.paper51.com Label9: TLabel; 内容来自论文无忧网 www.paper51.com private http://www.paper51.com { Private declarations } 内容来自论文无忧网 www.paper51.com public 内容来自论文无忧网 www.paper51.com { Public declarations } 内容来自论文无忧网 www.paper51.com end; paper51.com var 内容来自www.paper51.com GuanYuForm: TGuanYuForm; 内容来自论文无忧网 www.paper51.com implementation copyright paper51.com {$R *.DFM} 内容来自www.paper51.com
end. 内容来自www.paper51.com 3.4 考试题目界面与代码设计 paper51.com 内容来自论文无忧网 www.paper51.com 代码设计: 内容来自www.paper51.com unit kaoshi2; 内容来自论文无忧网 www.paper51.com interface 内容来自论文无忧网 www.paper51.com uses 内容来自www.paper51.com Windows,Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 内容来自论文无忧网 www.paper51.com StdCtrls,ExtCtrls, Db, DBTables, Buttons, DBCtrls, Mask; 内容来自论文无忧网 www.paper51.com type 内容来自论文无忧网 www.paper51.com TKaoshi2Form = class(TForm) copyright paper51.com
Table1: TTable; copyright paper51.com DataSource1: TDataSource; 内容来自论文无忧网 www.paper51.com Timer1: TTimer; paper51.com Panel1: TPanel; copyright paper51.com Panel2: TPanel; paper51.com GroupBox1: TGroupBox; 内容来自www.paper51.com shijian: TLabel; copyright paper51.com
Label2: TLabel; http://www.paper51.com jiaojuanbt: TBitBtn; copyright paper51.com Bianhao: TDBText; paper51.com Label1: TLabel; paper51.com Panel3: TPanel; copyright paper51.com Panel4: TPanel; copyright paper51.com Timu: TDBText; http://www.paper51.com Label5: TLabel; 内容来自论文无忧网 www.paper51.com Bevel1: TBevel; copyright paper51.com
Panel5: TPanel; copyright paper51.com Panel6: TPanel; 内容来自www.paper51.com
Label4: TLabel; http://www.paper51.com DBNavigator1: TDBNavigator; http://www.paper51.com
DBEdit1: TDBEdit; 内容来自www.paper51.com
Label3: TLabel; 内容来自论文无忧网 www.paper51.com DBText1: TDBText; paper51.com DBText2: TDBText; http://www.paper51.com DBText3: TDBText; paper51.com DBText4: TDBText; http://www.paper51.com Panel7: TPanel; http://www.paper51.com
DBImage1: TDBImage; 内容来自www.paper51.com BatchMove1: TBatchMove; 内容来自论文无忧网 www.paper51.com jiaojuan: TButton; http://www.paper51.com Label6: TLabel; 内容来自论文无忧网 www.paper51.com Panel8: TPanel; 内容来自论文无忧网 www.paper51.com DBText5: TDBText; 内容来自论文无忧网 www.paper51.com procedure Timer1Timer(Sender: TObject); copyright paper51.com procedure FormCreate(Sender: TObject); paper51.com procedure jiaojuanbtClick(Sender: TObject); http://www.paper51.com
procedure FormShow(Sender: TObject); 内容来自论文无忧网 www.paper51.com procedure jiaojuanClick(Sender: TObject); 内容来自www.paper51.com procedure Label4DblClick(Sender: TObject); 内容来自论文无忧网 www.paper51.com private http://www.paper51.com { Private declarations } paper51.com public 内容来自www.paper51.com { Public declarations } paper51.com end; http://www.paper51.com var copyright paper51.com Kaoshi2Form: TKaoshi2Form; http://www.paper51.com implementation 内容来自www.paper51.com uses kaishi,kaoshi1,Jieguo; http://www.paper51.com
{$R *.DFM} http://www.paper51.com procedure TKaoshi2Form.Timer1Timer(Sender: TObject); paper51.com begin paper51.com shijian.Caption:=intTostr(strToint(shijian.Caption)-1); 内容来自论文无忧网 www.paper51.com IF StrToInt(shijian.Caption)=0then 内容来自论文无忧网 www.paper51.com begin copyright paper51.com ifMessageDlg('时间已到,考试结束,请点[确定]查看分数。',mtConfirmation, [mbOk], 0) 内容来自www.paper51.com = mrOk then paper51.com begin 内容来自www.paper51.com
jiaojuan.OnClick(Sender); paper51.com end; copyright paper51.com end; paper51.com end; copyright paper51.com |