简体   繁体   中英

How to get smartcard reader name in Windows 7 using C# or C/C++?

I'm trying to make a C# program which will use a C .dll (unfortunately, the .dll doesn't have good documentation) to access a smart card. One of the functions of the .dll uses name of the reader as argument. My problem is that I don't know how to get the name.

After looking for answers I found something similar to what I need in an example here: http://msdn.microsoft.com/en-us/library/aa379803%28VS.85%29.aspx I'm looking for a way to get szReader value as described in the aforementioned example using C#. Can anyone help me or at least point me in the right direction?

EDIT: Looks like nobody knows the answer so I'll expand the question: How do I get smartcard reader name using C/C++ and Windows API? I've read through MSDN site for smartcard API, but I couldn't find the function which will list readers. My idea is now to make a C/C++ .dll which will get in-between the smartcard .dll and C# program. It will produce list of readers, let user chose one and call the smartcard .dll using chosen name as argument.

Try looking up the WinSCard api usage on Pinvoke.net . Specifically SCardListReaders . Also, this is possibly a duplicate question 268899 which has a great example of ScardListReaders. Good luck!

以下是一些有用的信息,即SCardListReaders的名称: http ://pcsclite.alioth.debian.org/api/winscard_8h.html我将尝试一下并报告结果。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM