private void button4_Click(object sender, EventArgs e) { byte port_value = 0; int status = 0; if (chkOutput1.Checked) { port_value |= 0x01; } if (chkOutput2.Checked) { port_value |= 0x02; } if (chkOutput3.Checked) { port_value |= 0x04; } if (chkOutput4.Checked) { port_value |= 0x08; } status = Reader1.SetGPIO_Out(port_value); if (status != 0) { lInfo.Items.Add("Set GPIO failed!"); return; } lInfo.Items.Add("Set GPIO success!"); }