public void Beep() { if (isDeviceOk) { // 蜂鸣 rt = WSR.ws_beep(port); } }
// 检测可用端口 public void Prepare() { if (!isDeviceOk) { for (int i = 0; i < 50; i++) { int result = WSR.ws_openPort(i); if (result >= 0) { port = i; isDeviceOk = true; break; } } } }
// 获取卡号,如果读取失败或没有Prepare成功,那么返回null public String GetCardNo() { if (isDeviceOk) { uint cardno = 0; rt = WSR.ws_getCardNo(port, ref cardno); if (rt >= 0) { return(cardno.ToString()); } else { return(null); } } else { return(null); } }