我已经写代码来枚举智能卡设备,在C;这里是我使用的代码;
干杯, 精读
int findDevice(){
hContext = NULL;
log("\nSearching for the following device: XXX eKrypto Pinpad\n");
//Get a context to the resource manager
lReturn = SCardEstablishContext(SCARD_SCOPE_USER,NULL,NULL,&hContext);
log("Context established.\n");
if(lReturn != SCARD_S_SUCCESS){
logBytes("SCardEstablishContext failed with error: ", (byte *)&lReturn, sizeof(LONG));
return 0;
}
contextEstablished = true;
//Get the readers list
DWORD chReaders = 250;
lReturn = SCardListReaders(hContext,NULL,readerNames,&chReaders);
log("Reader List obtained.\n");
if(lReturn != SCARD_S_SUCCESS){
logBytes(" SCardListReaders failed with error: \n", (byte *)&lReturn, sizeof(LONG));
return 0;
}
//Search for device
char *pReaders = readerNames;
log(pReaders);
while(strlen(pReaders) != 0 && deviceFound == false){
if(!memcmp(pReaders, "ETS eKrypto Pinpad", 18)){
deviceFound = true;
memcpy(currentReader, pReaders, strlen(pReaders));
}
pReaders += strlen (pReaders)+1;
}
if(deviceFound == false){
log(" Specified ETS device not found\n");
return 0;
}
log(" Successful\n");
return 1;
}
你的想法是太糟糕了。我有两个智能卡读卡器,第一个内部USB读卡器和戴尔智能卡键盘。在我的应用程序中,我测试了很多智能卡,从未看到它们充当可移动磁盘。 – Xearinox 2012-05-20 21:29:41
我正在谈论Java smard卡,它可以用作手机中的加密卡和存储卡。在移动设备中,它将充当存储卡,但对于移动应用程序,它也将充当java智能卡。我正在开发使用智能卡的Android手机应用程序。在系统中它会检测为存储卡。希望你在谈论其他类型的智能卡 – DAC84 2012-05-21 14:24:49