//读卡 public IDCard ReadCard(IDCard IC) { try { iConnectionState = IC.InitComm(); if (iConnectionState == 1) { int iResult = 0; while (iResult != 2) { iResult = IC.ReadCardContent(); Thread.Sleep(100); } } else { IC = null; } } catch (Exception ex) { IC = null; LogImpl.Error(string.Format("{0}{2}{1}", ex.StackTrace, ex.Message, System.Environment.NewLine)); } return(IC); }
public static Boolean Open() { var value = wrapper.InitComm(); var result = value == 1; if (!result) { Logger.Error($"身份证读卡器初始化失败:[{value.ToString()}]"); } return(result); }