【发布时间】:2014-01-05 11:52:13
【问题描述】:
这是我第一次尝试在 C# 或任何地方使用读卡器。
我在 Windows 7 64 位中使用 ACS ACR122U PICC Interface 0 阅读器。
当我尝试使用
连接到阅读器时,出现了我的第一个问题ModWinsCard.SCardConnect(hContext, cbReader.SelectedItem.ToString(), ModWinsCard.SCARD_SHARE_DIRECT, 0, ref hCard, ref Protocol);
它返回错误代码 6,但我搜索并通过将项目平台从 Any CPU 更改为 X86 来解决它。
紧接着我遇到了另一个问题,这次是在控制阅读器方面。
我试过了:
_sentBuffer = new byte[]
{
0xFF,
0x00,
0x48,
0x00,
0x00
};
_receivedBuffer = new byte[10];
_receivedBuffer[0] = 0;
_returnCode = ModWinsCard.SCardControl(_hCard, _dwControlCode, ref _sentBuffer[0], _sentBuffer.Length, ref _receivedBuffer[0], _receivedBuffer.Length, ref bytesReturned);
返回的代码是1,这很奇怪,因为我在documentation中找不到。
真的需要帮忙。
谢谢!
【问题讨论】: