public static void waitBankCard() { StringBuilder info1 = new StringBuilder(260); try { string port = SysConfigHelper.readerNode("CRT310Port"); StringBuilder info = new StringBuilder(260); int handle = CRT310.TT_OpenDevice(new StringBuilder("COM" + port), new StringBuilder("9600"), new StringBuilder()); CRT310.TT_SetCardMode(1, info1); StringBuilder info2 = new StringBuilder(260); CRT310.TT_WaitCard(0, info2).ToString(); //停卡位置 CRT310.CRT310_CardPosition(handle, 0x4); } catch (Exception e) { throw new Exception("系统异常"); } finally { //关闭端口 CRT310.TT_CloseDevice(info1); } }