Пример #1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            if (IsOpened)
            {
                int      tagcount  = 0;
                String[] tagnumber = new String[0];
                Int32    value     = reader.Inventory(ISO15693Reader.ModulateMethod.ASK, ISO15693Reader.InventoryModel.Single, ref tagcount, ref tagnumber);// .GetOne(ref data);

                // Inventory(data, 0x27, ref tagCount);
                if ((value != 0) && (tagnumber.Length > 0))
                {
                    tb_label.Text = tagnumber[0];
                    //label_show.Text = "读取成功!";
                    OleDbConnection conn = new OleDbConnection();
                    conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Database.mdb;Persist Security Info=True";
                    conn.Open();
                    String          sql = String.Format("SELECT CardId FROM tab_label WHERE ID='{0}'", tb_label.Text.Trim());
                    OleDbCommand    cmd = new OleDbCommand(sql, conn);
                    OleDbDataReader dr  = cmd.ExecuteReader();
                    if (dr.Read())
                    {
                        label_show.Text = "此为旧卡,无法添加";
                    }
                    else
                    {
                        label_show.Text = "此为新卡,可添加";
                    }
                    return;
                }
                label_show.Text = "读取失败";
                tb_label.Text   = "";
            }
            else
            {
                label_show.Text = "请先打开串口!";
            }
        }
Пример #2
0
        private void Main_read(object sender, EventArgs e)
        {
            if (IsConnected == false)
            {
                main_remain.Text = "未连接设备";
                return;
            }

            int tagCount = 0;

            String[] tagNumber = new string[0];
            int      value     = reader.Inventory(ISO15693Reader.ModulateMethod.ASK, ISO15693Reader.InventoryModel.Single, ref tagCount, ref tagNumber);

            if (value != 0 && tagNumber.Length > 0)
            {
                main_remain.Text = "读取失败";
                return;
            }
            main_tag_id         = tagNumber[0];
            main_remain.Text    = "读取成功";
            main_doc_id.Enabled = true;
            main_text_append(main_tag_id);
        }