c# - 智能卡读卡器命名

标签 c# smartcard smartcard-reader pcsc winscard

我的系统中有两个读卡器 (HID OMNIKEY 5321)(每个读卡器执行不同的功能)

  • 读卡器 1 -“智能卡读卡器 0
  • 读卡器 2 - “智能卡读卡器 1

在我的程序中设置了

  • “智能卡读卡器0”- 操作 1
  • “智能卡读卡器1”- 操作 2

但有时(无需重新启动,可能失去联系)

  • 读卡器 1 的名称为“智能卡读卡器 1
  • 读卡器 2 的名称为“智能卡读卡器 0

并且该程序无法满足用户的需求。 我在 WinScard.dll 中使用 SCardGetStatusChange (需要读取器的名称)

该怎么办? 有没有办法更改读卡器的名称(固件、驱动程序...)? 可以使用读卡器的序列号吗?

我也看了,但没有结果 Smartcard reader naming: when removing any reader, the name of the rest changes How are PCSC smart card reader 'friendly names' constructed?

最佳答案

找到解决方案Getting PCSC reader serial number with WinSCard

序列号读取器

...
SCardConnect(hContext, readerName, SCARD_SHARE_DIRECT, SCARD_PROTOCOL_UNDEFINED, ref hCard, ref protocol);
SCardGetAttrib(hCard, SCARD_ATTR_VENDOR_IFD_SERIAL_NO, receiveBuffer, ref receivebufferLen);
...

关于c# - 智能卡读卡器命名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24612817/

相关文章:

android - HCE - 有没有办法操纵 ATR?

hid - 通过 HID OMNIKEY 5427 CK 向卡发送 APDU 命令

c# - 更新数据库 Image 只存储 0x

c# - mysql中的存储MapPaths(使用c#)

python - 使用 pkcs11 模块使用公钥加密数据失败

android - 通过 Android USB 主机与智能卡读卡器通信

javascript - OnTextChanged 函数未触发

c# - 当用户双击其关联文件时,如何打开应用程序?

certificate - 仅从 DoD CAC 卡获取姓名/UID

smartcard - "acr38 card tools"和 "opensc"有什么区别?