如何使用.NET平台阅读智能卡ACS 38。 [英] How do I read Smart Card ACS 38 using .NET platform.

查看:85
本文介绍了如何使用.NET平台阅读智能卡ACS 38。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

'Establish context and obtain hContext handle
       retcode = ModWinsCard.SCardEstablishContext(ModWinsCard.SCARD_SCOPE_USER, 0, 0, hContext)
       If retcode <> ModWinsCard.SCARD_S_SUCCESS Then
           MessageBox.Show(" Could not establish Connection")
           RichTextBoxLogs.Clear()
           RichTextBoxLogs.Text = "Not Initialized"
           Exit Sub
       End If

       retcode = ModWinsCard.SCardListReaderGroups(hContext, sReaderGroup, ReaderGroup)
       If retcode <> ModWinsCard.SCARD_S_SUCCESS Then
           'DisplayOut(GetScardErrMsg(retcode))
           RichTextBoxLogs.Clear()
           RichTextBoxLogs.Text = "List not found"
           Exit Sub
       End If


       'List PCSC card readers installed
       retcode = ModWinsCard.SCardListReaders(hContext, sReaderGroup, sReaderList, ReaderCount)
       If retcode <> ModWinsCard.SCARD_S_SUCCESS Then
           'DisplayOut(GetScardErrMsg(retcode))
           RichTextBoxLogs.Clear()
           RichTextBoxLogs.Text = "Card not installed"
           Exit Sub
       End If

       RichTextBoxLogs.Text = "Hello Connecting"



       ' Connect to the reader using hContext handle and obtain hCard handle
       retcode = ModWinsCard.SCardConnect(hContext, cmbReaderPort.Text, 1, 0 Or 1, hCard, Aprotocol)

       If (retcode <> ModWinsCard.SCARD_S_SUCCESS) Then
           MessageBox.Show("Connection Error")
       Else

           MessageBox.Show("Connection OK")

       End If





我的意思是涉及的步骤如下:创建句柄,开幕式,我开始检测连接到系统的设备。任何帮助都会非常值得赞赏。



提前致谢



I mean what are broad steps involved like : creating Handle , Opening Session, I did start with detecting the device attached to the system. Any help will be highly appreciable.

Thanks in advance

推荐答案

这篇关于如何使用.NET平台阅读智能卡ACS 38。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆