private void GetPRVs() { //检测正负压阀状态 bool z = false, f = false; var res = tcpClient.GetZFYF(ref z, ref f); if (!res) { MessageBox.Show("压阀状态异常,请确认服务器连接是否成功!", "检测状态", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification); } btn_z.BackColor = z ? Color.Green : Color.Transparent; btn_f.BackColor = f ? Color.Green : Color.Transparent; }
private void GetPRVs() { //检测正负压阀状态 bool z = false, f = false; var res = tcpClient.GetZFYF(ref z, ref f); if (!res) { return; // MessageBox.Show("压阀状态异常,请确认服务器连接是否成功!", "检测状态", MessageBoxButtons.OK, MessageBoxIcon.Warning); } btn_z.BackColor = z ? Color.Green : Color.Transparent; btn_f.BackColor = f ? Color.Green : Color.Transparent; }