private void _97IdReadSet(object sender, EventArgs e) { Button btn = (Button)sender; TextBox tbVal = new TextBox(); TextBox tbId = new TextBox(); string res = string.Empty; Protocol645 p645 = new Protocol645(); if (btn == btnRead1 || btn == btnSet1) { tbId = txtId1; tbVal = txtData1; } if (btn == btnRead2 || btn == btnSet2) { tbId = txtId2; tbVal = txtData2; } if (btn == btnRead1 || btn == btnRead2) { tbVal.Text = ""; Functions.Delay(10); p645.SF_ReadData(tbId.Text, out res); tbVal.Text = res; } if (btn == btnSet1 || btn == btnSet2) { if (!p645.SF_SetData(tbId.Text, tbVal.Text)) { //statusReturn.Text = ""; } } }
private void btnSetC14D_Click(object sender, EventArgs e) { string data = txtSc14d.Text.PadLeft(2, '0'); Protocol645 p645 = new Protocol645(); if (!p645.SF_SetData("C14D", data)) { MessageBox.Show("设置失败!"); } }