C#上位机开发串口通信编程

p4作业:
按钮里的代码怎么改就行:
private void button1_Click(object sender, EventArgs e)
{
int clickTimes; //按下du次数
//获取按zhi下次数
object tag = this.button1.Tag;
if (tag == null)
{
clickTimes = 0;
}
else
{
clickTimes = Convert.ToInt32(tag);
}
//增加并记录按下次数
this.button1.Tag = ++clickTimes;
if ((clickTimes % 2) == 1)
{
//执行你的事dao情1
string str = comboBox1.Text;
time = Convert.ToUInt16(str.Substring(0, 2));
progressBar1.Maximum = time;
timer1.Start();
button1.Text = "停止计时";
}
else
{
timer1.Stop();
}
}