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.

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top