这个是当打字正确的代码!!
if (str.Equals(this.label1.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t1.Abort();
t1Begin();
}
else if (str.Equals(this.label4.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t2.Abort();
t2Begin();
}
else if (str.Equals(this.label5.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t3.Abort();
t3Begin();
}
else if (str.Equals(this.label6.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t4.Abort();
t4Begin();
}
else if (str.Equals(this.label7.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t5.Abort();
t5Begin();
} else
{
this.textBox2.Text = (++countfalse).ToString();
if (int.Parse(this.textBox2.Text) >= 10)
{
t1.Abort();
t2.Abort();
t3.Abort();
t4.Abort();
t5.Abort();
endtime = DateTime.Now;
MessageBox.Show("你已经挑战失败!", "消息");
Form3 f3 = new Form3(this);
this.Hide();
f3.Show();
}
}
public void luo()
{
int letter = 0;
Random r = new Random();
int j = 1 + r.Next(10);
int y = r.Next(300);
if (r.Next(10) > 5)
{
letter = 65 + r.Next(26);
}
else
{
letter = 97 + r.Next(26);
}
this.thisLabel.Text = ((char)letter).ToString();
for (int i = 5; i < 350; i += j)
{
if (i >= 330)
{
i = 0;
lock (this)
{
int num = f.countfalse++;
f.textBox2.Text = num.ToString();
}
if (int.Parse(f.textBox2.Text) >= 10)
{
if (f.n == 1)
{
f.t1.Abort();
f.t2.Abort();
f.t3.Abort();
f.endtime = DateTime.Now;
MessageBox.Show("你已经挑战失败!", "消息");
Form3 f3 = new Form3(f);
f.Hide();
f3.Show();
}
else if (f.n == 3)
{
f.t1.Abort();
f.t2.Abort();
f.t3.Abort();
f.t4.Abort();
f.t5.Abort();
f.endtime = DateTime.Now;
MessageBox.Show("你已经挑战失败!", "消息");
Form3 f3 = new Form3(f);
f.Hide();
f3.Show();
}
else
{
f.t1.Abort();
f.t2.Abort();
f.t3.Abort();
f.t4.Abort();
f.t5.Abort();
f.t6.Abort();
f.t7.Abort();
f.endtime = DateTime.Now;
MessageBox.Show("你已经挑战失败!", "消息");
Form3 f3 = new Form3(f);
f.Hide();
f3.Show();
}
} }
this.thisLabel.Location = new Point(y, i);
Thread.Sleep(100);
}
if (str.Equals(this.label1.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t1.Abort();
t1Begin();
}
else if (str.Equals(this.label4.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t2.Abort();
t2Begin();
}
else if (str.Equals(this.label5.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t3.Abort();
t3Begin();
}
else if (str.Equals(this.label6.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t4.Abort();
t4Begin();
}
else if (str.Equals(this.label7.Text))
{
this.textBox1.Text = (++counttrue).ToString();
t5.Abort();
t5Begin();
} else
{
this.textBox2.Text = (++countfalse).ToString();
if (int.Parse(this.textBox2.Text) >= 10)
{
t1.Abort();
t2.Abort();
t3.Abort();
t4.Abort();
t5.Abort();
endtime = DateTime.Now;
MessageBox.Show("你已经挑战失败!", "消息");
Form3 f3 = new Form3(this);
this.Hide();
f3.Show();
}
}
public void luo()
{
int letter = 0;
Random r = new Random();
int j = 1 + r.Next(10);
int y = r.Next(300);
if (r.Next(10) > 5)
{
letter = 65 + r.Next(26);
}
else
{
letter = 97 + r.Next(26);
}
this.thisLabel.Text = ((char)letter).ToString();
for (int i = 5; i < 350; i += j)
{
if (i >= 330)
{
i = 0;
lock (this)
{
int num = f.countfalse++;
f.textBox2.Text = num.ToString();
}
if (int.Parse(f.textBox2.Text) >= 10)
{
if (f.n == 1)
{
f.t1.Abort();
f.t2.Abort();
f.t3.Abort();
f.endtime = DateTime.Now;
MessageBox.Show("你已经挑战失败!", "消息");
Form3 f3 = new Form3(f);
f.Hide();
f3.Show();
}
else if (f.n == 3)
{
f.t1.Abort();
f.t2.Abort();
f.t3.Abort();
f.t4.Abort();
f.t5.Abort();
f.endtime = DateTime.Now;
MessageBox.Show("你已经挑战失败!", "消息");
Form3 f3 = new Form3(f);
f.Hide();
f3.Show();
}
else
{
f.t1.Abort();
f.t2.Abort();
f.t3.Abort();
f.t4.Abort();
f.t5.Abort();
f.t6.Abort();
f.t7.Abort();
f.endtime = DateTime.Now;
MessageBox.Show("你已经挑战失败!", "消息");
Form3 f3 = new Form3(f);
f.Hide();
f3.Show();
}
} }
this.thisLabel.Location = new Point(y, i);
Thread.Sleep(100);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货