/// <summary> /// 获取存储的含有AdmissionExit的二进制数据 /// </summary> /// <param name="hisDt"></param> public void getBinaryAdmissionExitData(DateTime hisDt) { FilePath = getDateTimeStr(hisDt); DataFileUtils daUtils = new DataFileUtils(); bt = daUtils.getDataFromFile(FilePath); //List<byte[]> admissionExits = getAdmissionExitBt(data); }
/// <summary> /// 读取卡片的二进制数据 /// </summary> /// <param name="fileName"></param> /// <param type="type">0 = TCP发送出去的数据,1 = 取出来的原始数据</param> /// <returns></returns> public List <byte[]> getHisFileListDataData(string fileName, int type) { DataFileUtils dFileUtils = new DataFileUtils(); byte[] data = dFileUtils.getDataFromFile(fileName4 + fileName); List <byte[]> chcheBy = new List <byte[]>(); int index_da = 0; int dataLength = 27; //取出数据到TCP发送的数据包长度 while (true && data != null) { try { int ov_index; getIndexOver(data, ref index_da, out ov_index, dataLength); if (ov_index > data.Length) { break; } if (ov_index - index_da - 4 < 1) { index_da++; continue; } byte[] cardData = new byte[ov_index - index_da - 4]; Array.Copy(data, index_da + 4, cardData, 0, cardData.Length); if (cardData.Length > 21 && type == 0) { byte[] hisData = getChongZuData(cardData); ///将历史数据组装起来 chcheBy.Add(hisData); ///组装的数据保存再此处 } else if (type == 1) { chcheBy.Add(cardData); } index_da = ov_index + 4; } catch (Exception e) { index_da++; Debug.Write("getHisFileListDataData.." + e.Message); } } return(chcheBy); }