我正在尝试使用ACR122附带的C#设备编程示例在Windows8上试用SDK卡读卡器。当我启动示例时,在可用设备列表中看不到读卡器。
我不认为这是一个通用的驱动程序问题,因为配置读取器的工具(预编译的二进制文件)列出了读取器并允许连接到它。
我是C#和.NET的新手,如果有人能给我一些建议来判断哪里出了问题,我会很高兴的。如果您需要更多信息,我很乐意为您提供。
发布于 2013-10-14 15:50:17
我也不是专家,我目前正在使用ACR122U阅读器,示例对我来说也不是很好。但是,我能够编写一个小的C#程序,这样我就可以在智能卡上读/写少量的文本(转换为十六进制)。因此,我建议您尝试自己编写它,就像我一样,我将给您一些启动代码(我使用的是pcsc-sharp dll):
using PCSC;
namespace SmartcardCheck
{
class Program
{
static void Main(string[] args)
{
using (var context = new SCardContext())
{
context.Establish(SCardScope.System);
string[] readerNames = null;
try
{
// retrieve all reader names
readerNames = context.GetReaders();
// get the card status of each reader that is currently connected
foreach (var readerName in readerNames)
{
using (var reader = new SCardReader(context))
{
Console.WriteLine("Trying to connect to reader {0}.", readerName);
var sc = reader.Connect(readerName, SCardShareMode.Shared, SCardProtocol.Any);
if (sc == SCardError.Success)
{
DisplayReaderStatus(reader);
}
else
{
Console.WriteLine("No card inserted or reader is reserved exclusively by another application.");
Console.WriteLine("Error message: {0}\n", SCardHelper.StringifyError(sc));
}
}
}
}
catch (Exception)
{
if (readerNames == null)
{
Console.WriteLine("No readers found.");
return;
}
}
Console.ReadKey();
}
}
}
}希望它能帮助您:)
发布于 2013-08-21 14:39:01
ACR122不被视窗视作NFC (接近)设备,它是一种智能卡设备,具有读取NFC卡的能力。要在现代应用程序中或通过Windows使用它,你实际上需要使用Windows8.1,它引入了对智能卡的支持。
https://stackoverflow.com/questions/18150839
复制相似问题