private void sendCommand(String command) { try { Port.Write(command); Port.Flush(); toolStripMessage.Text = "Command : " + command; //successful } catch { } }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (RobotPort != null) { RobotPort.Write(new byte[1] { 0 }, 0, 1); } if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }