Question

I am new to smart card development. What I am trying to do is,
1>get the name of the card reader.
2>connect to the card in the card reader.
3>change the admin key of the card using c# .

for the first point i used winscard.DLL- function SCardListReaders. It worked well.
now for next step, I tried with function -SCardConnect of winscard.dll.

but when ever i am running this , it returns "6", but it should return 0. I am really confused.
Any idea, what that means? where i am doing wrong?
Please help.
Thank you in advance.

Était-ce utile?

La solution

You can refer here for smart card return values. And if not listed, you can refer here for system error codes.

The error code 6 is ERROR_INVALID_HANDLE. Try to check your OS (32-bit or 64-bit) and your smart card driver (32-bit or 64-bit). Ensure that they are the same. Also, check that your codes are using the correct variable type.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top