private void 关机SToolStripMenuItem_Click(object sender, EventArgs e) { TreeNode tn = trv_HostView.SelectedNode; if (tn != null && tn.Tag != null) { DialogResult result = MessageBox.Show("确定关闭远程主机" + tn.Tag.ToString() + "吗?", "关闭确认", MessageBoxButtons.OKCancel); if (result == DialogResult.OK) { GeneralControler.CloseWindows(tn.Tag); } } else { MessageBox.Show("当前主机已经断开了连接,请移除它,然后再连接"); } }