我正在尝试制作一个 C# 程序,它将使用 C .dll(不幸的是,.dll 没有良好的文档)来访问智能卡。 .dll 的函数之一使用阅读器的名称作为参数。我的问题是我不知道如何获得这个名字。
寻找答案后,我发现了与我在示例中需要的类似的内容: http://msdn.microsoft.com/en-us/library/aa379803%28VS.85%29.aspx 我正在寻找一种方法来获取 szReader 值,如上述所述使用 C# 的示例。谁能帮助我或至少为我指出正确的方向?
编辑:看起来没有人知道答案,所以我将扩展问题:如何使用 C/C++ 和 Windows API 获取智能卡读卡器名称?我已经阅读了 MSDN 网站上的智能卡 API,但找不到列出读者的功能。我现在的想法是制作一个 C/C++ .dll,它将介于智能卡 .dll 和 C# 程序之间。它将生成读卡器列表,让用户选择一个并使用所选名称作为参数调用智能卡 .dll。
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.
发布评论
评论(2)
尝试在 Pinvoke.net。具体来说是SCardListReaders。另外,这可能是重复的问题268899 其中有一个很好的 ScardListReaders 示例。祝你好运!
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 我会尝试一下并报告结果。
Here's some info on the subject that seems useful, namely the name of SCardListReaders: http://pcsclite.alioth.debian.org/api/winscard_8h.html I'll try it out and report results.