c#答题测试面板代码

c#答题测试面板代码

ID:13528066

大小:102.00 KB

页数:16页

时间:2018-07-23

c#答题测试面板代码_第1页
c#答题测试面板代码_第2页
c#答题测试面板代码_第3页
c#答题测试面板代码_第4页
c#答题测试面板代码_第5页
资源描述:

《c#答题测试面板代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Data.OleDb;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsFormsApplication2{publicpartialclassForm1:Form{publicForm1(){Initial

2、izeComponent();}privatevoidpictureBox1_Click(objectsender,EventArgse){}publicstaticstringkaohao,password;OleDbConnectionconn=newOleDbConnection();OleDbCommandcomm=newOleDbCommand();OleDbDataAdapteradapter=newOleDbDataAdapter();DataSetds=newDataSet();privatevoidForm1_Load(obj

3、ectsender,EventArgse){if(timer1.Enabled==false){timer1.Enabled=true;}}privatevoidbutton1_Click_1(objectsender,EventArgse){kaohao=txthao.Text;password=txtmima.Text;stringconnString="Provider=Microsoft.Jet.OleDb.4.0;DataSource=user.mdb";OleDbConnectionconn=newOleDbConnection(c

4、onnString);stringoledb=string.Format("selectcount(*)from[user]wherekaohao='{0}'andpassword='{1}'",kaohao,password);try{conn.Open();OleDbCommandcomm=newOleDbCommand(oledb,conn);intnum=(int)comm.ExecuteScalar();if(num>0){this.Hide();formform=newform();form.Show();}else{Message

5、Box.Show("考号、密码可能不准确!","登录失败",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);txthao.Text="";txtmima.Text="";txthao.Focus();}}finally{conn.Close();}}privatevoidbutton2_Click(objectsender,EventArgse){this.Close();}privatevoidtexthao_TextChanged(objectsender,EventArgse){}priv

6、atevoidlabel1_Click(objectsender,EventArgse){}privatevoidtimer1_Tick(objectsender,EventArgse){intt;t=label1.Top+label1.Height;label1.Top=label1.Top-2;if(t<0)label1.Location=newPoint(1,125);}}}Form2——考试说明界面作用:考生阅读考试的相关规定,准备答题。所用控件:1个label,1个linklabel,1个checkbox,1个groupbox设计思路

7、:详细内容:属性较特殊的需要说明。代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsFormsApplication2{publicpartialclassform:Form{publicform(){Initialize

8、Component();}privatevoidForm2_Load(objectsender,EventArgse){lklbl1.Enabled=

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。