using
using
using
using
using
using
using
usingSystem;System.Collections.Generic;System.ComponentModel;System.Data;System.Drawing;System.Linq;System.Text;System.Windows.Forms;
namespaceWindowsFormsApplication2
{
publicpartialclassForm1:Form
{
publicForm1()
{
InitializeComponent();
}
privatevoidbutton1_Click(objectsender,EventArgse){
Stringa;
a=Microsoft.VisualBasic.Interaction.InputBox("请输入考场号","","54-72-2009",
15,
15);
if(a.Length!=12)
{
MessageBox.Show("请重新输入考场号
","",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
else
{
String[]id=a.Split('-');
DialogResultr=MessageBox.Show("您的考场号为:"+id[0]+id[1]+id[2]+id[3],"",
MessageBoxButtons.YesNoCancel);
if(r==DialogResult.Yes)
{
MessageBox.Show("该考生考生是"+a.Substring(6,4)+"年入学的","确认",
MessageBoxButtons.OK,MessageBoxIcon.None);
button1.Enabled=false;
button2.Enabled=true;
}
else
{MessageBox.Show("请重新输入:","错误提示",MessageBoxButtons.OK,
MessageBoxIcon.None);}
}
}
privatevoidbutton2_Click(objectsender,EventArgse)
{
int[]b=newint[20];
Randomran=newRandom();
for(inti=0;i<b.Length;i++)
{
one_num:b[i]=(int)ran.Next(20)+1;
for(intj=0;j<i;j++)
{
if(b[i]==b[j])
gotoone_num;
}
}
intt=1;
while(t<=20)
{
foreach(intninb)
MessageBox.Show("第"+t+++"位学生的试卷编号为:"+n);
}
}
privatevoidForm1_Load(objectsender,EventArgse)
{
}
}
}
www.99jianzhu.com/包含内容:建筑图纸、PDF/word/ppt 流程,表格,案例,最新,免费下载,施工方案、工程书籍、建筑论文、合同表格、标准规范、CAD图纸等内容。