public ReadCardResult ReadCard() { ReadCardResult result = new ReadCardResult(); long cardID = 0; Card_Info info = new Card_Info(); try { if (ReadCardInfo(ref info) == 1) { if (WegenType == WegenType.Wengen26) { cardID = info.Card_ID[7] + info.Card_ID[6] * 256 + info.Card_ID[5] * 256 * 256; } else if (WegenType == WegenType.Wengen34) { cardID = info.Card_ID[7] + info.Card_ID[6] * 256 + info.Card_ID[5] * 256 * 256 + info.Card_ID[4] * (long)(256 * 256 * 256); } if (cardID > 0) { result.CardID = cardID.ToString(); return(result); } } } catch { } return(result); }
public void Init() { Card_Info info = new Card_Info(); try { ReadCardInfo(ref info); State = ReaderState.InWork; } catch { State = ReaderState.OutOfWork; } }
private static extern short ReadCardInfo(ref Card_Info cardInfo);