public void endConnection() { connectionEnded(); }
private void btnClose_Click(object sender, EventArgs e) { if (!Client.endConnection()) { MessageBox.Show("关闭失败!!"); } else { MessageBox.Show("连接成功关闭!!"); this.btnClose.Enabled = false; this.btnBegin.Enabled = true; } }