public void SetAllCardReader() { //初始化设备,订阅日志 PcscCardReader device = new PcscCardReader(); string[] dd = device.GetAllReader(); comboBox1.Items.AddRange(device.GetAllReader()); if (comboBox1.Items.Count > 0) { comboBox1.SelectedIndex = 0; } }
/// <summary> /// 使用标准的PCSC设备 /// </summary> public void SelectPCSCDevice() { if (!string.IsNullOrWhiteSpace(comboBox1.SelectedItem.ToString())) { PcscCardReader device = new PcscCardReader(); device.CardReaderName = comboBox1.SelectedItem.ToString(); if (!device.OpenReader(out string msg)) { MessageBox.Show(msg); } else { CardReader = new CpuCard(device); } } }