private void btnStop_Click(object sender, EventArgs e) { PacketWriter w = new PacketWriter(); w.Write((int)PacketHeader.FLOOD_STOP); main.Send(w.ToArray(true)); if (FloodTimer.Running) { FloodTimer.StopTimer(); } }
private void btnStop_Click(object sender, EventArgs e) { main.FloodPacket = null; PacketWriter w = new PacketWriter(); w.Write((int)PacketHeader.FLOOD_STOP); byte[] b = w.ToArray(true); main.Send(b); if (xTimer.Checked) { FloodTimer.StopTimer(); } if (t != null && t.IsAlive) { t.Abort(); t = null; lblChecker.Text = "Idle..."; } }