|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using UHFHelper;
-
- namespace test
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- //жϴǷ
- if (!UHFCardHelper.GetInstance().ComOpen)
- {
- Resultoutput resultoutput = UHFCardHelper.GetInstance().OpenPort();
- if (resultoutput.Res)
- {
- MessageBox.Show(resultoutput.ResMes);
- }
- else
- {
- MessageBox.Show(resultoutput.ResMes);
- }
- }
- }
-
- private void button2_Click(object sender, EventArgs e)
- {
- if (!UHFCardHelper.GetInstance().ComOpen)
- {
- MessageBox.Show("δ");
- return;
- }
- string res = UHFCardHelper.GetInstance().ReadCard();
- label1.Text = res;
- }
-
- private void button3_Click(object sender, EventArgs e)
- {
- UHFCardHelper.GetInstance().ClosePort();
- }
-
- private void button4_Click(object sender, EventArgs e)
- {
- var res = UHFCardHelper.GetInstance().WriteCard(textBox1.Text);
- MessageBox.Show(res.ResMes);
- }
- }
- }
|