日期:2014-05-18 浏览次数:20880 次
ListViewItem lv = new ListViewItem("192.168.7.100"); lv.SubItems.Add("RFIDSCAN_TEST"); lv.SubItems.Add("L70"); lv.SubItems.Add("32"); lv.SubItems.Add("Assembly Start"); lv.SubItems.Add("Y"); lv.SubItems.Add(""); listView1.Items.Add(lv); ListViewItem lv2 = new ListViewItem("192.168.7.101"); lv2.SubItems.Add("RFIDSCAN_TEST"); lv2.SubItems.Add("L70"); lv2.SubItems.Add("35"); lv2.SubItems.Add("Assembly End"); lv2.SubItems.Add("N"); lv2.SubItems.Add(""); listView1.Items.Add(lv2);
if (listView1.Items.Count > 0) { for (int i = 0; i < listView1.Items.Count; i++) { strReaderIP = listView1.Items[i].SubItems[0].Text; if (Regex.IsMatch(strReaderIP, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$")) { // RFIDParms rfidparms = new RFIDParms(); res = Reader2600.Net_ConnectScanner(ref m_hSocket, strReaderIP, nReaderPort, strHostIP, nHostPort); if (res == OK) { rfidparms.m_hSocket = m_hSocket; rfidparms.res = OK; rfidparms.strReaderIP = strReaderIP; Lrfidparms.Add(rfidparms); } }
if (Lrfidparms.Count() > 0) { for (int f = 0; f < Lrfidparms.Count; f++) { bIsConnected = true; nConnectMode = 1; Read_times = 0; k = 0; res = Reader2600.Net_EPC1G2_ReadLabelID(Lrfidparms[f].m_hSocket, mem, ptr, len, mask, IDBuffer, ref nCounter);
“System.AccessViolationException: 尝试读取或写入受保护的内存”
res = Reader2600.Net_ConnectScanner(ref m_hSocket, strReaderIP, nReaderPort, strHostIP, nHostPort); if (res == OK) { rfidp