private void timer1_Tick(object sender, EventArgs e) { int status; int i, j; byte[,] IsoBuf = new byte[100, 12]; byte tag_cnt = 0; string s = ""; string s1 = ""; if (cIsoTimes.SelectedIndex > 0) { Api.ClearIdBuf(); ScanTimes--; } status = Api.IsoMultiTagIdentify(ref IsoBuf, ref tag_cnt); if (tag_cnt > 0) { for (i = 0; i < tag_cnt; i++) { s1 = string.Format("NO.{0:D}: ", TagCnt); for (j = 0; j < 8; j++) { s = string.Format("{0:X2} ", IsoBuf[i, j]); s1 += s; } lInfo.Items.Add(s1); TagCnt++; } } if (ScanTimes <= 0) { bIsoId_Click(sender, e); } }
private void timer1_Tick(object sender, EventArgs e) { int status; int i, j; byte[,] IsoBuf = new byte[100, 12]; byte tag_cnt = 0; string s = ""; string s1 = ""; int listIn = 0; // Filter same tag if (!chkFilter.Checked) { Reader1.ClearIdBuf(); } status = Reader1.IsoMultiTagIdentify(ref IsoBuf, ref tag_cnt); if (tag_cnt > 0) { for (i = 0; i < tag_cnt; i++) { s1 = ""; for (j = 0; j < 8; j++) { s = string.Format("{0:X2} ", IsoBuf[i, j]); s1 += s; } lInfo.Items.Add(s1); ListViewItem lviList = new ListViewItem(); if (lvTagList.Items.Count <= 0) { lviList.SubItems[0].Text = "1"; for (i = 0; i <= 2; i++) { lviList.SubItems.Add(""); } lvTagList.Items.Add(lviList); listIn = 0; lvTagList.Items[listIn].SubItems[1].Text = s1; lvTagList.Items[listIn].SubItems[2].Text = "1"; } else { listIn = -1; for (i = 0; i < lvTagList.Items.Count; i++) { if (lvTagList.Items[i].SubItems[1].Text == s1) { listIn = i; break; } } if (listIn < 0) { listIn = lvTagList.Items.Count; lviList.SubItems[0].Text = Convert.ToString(listIn + 1); for (i = 0; i <= 2; i++) { lviList.SubItems.Add(""); } lvTagList.Items.Add(lviList); } lvTagList.Items[listIn].SubItems[1].Text = s1; if (lvTagList.Items[listIn].SubItems[2].Text == "") { lvTagList.Items[listIn].SubItems[2].Text = "0"; } Int64 intTimes = Convert.ToInt64(lvTagList.Items[listIn].SubItems[2].Text); lvTagList.Items[listIn].SubItems[2].Text = Convert.ToString(intTimes + 1); } TagCnt++; } } if (ScanTimes <= 0) { bIsoId_Click(sender, e); } }