Dim hContext As IntPtr Dim rc As IntPtr Dim dwScope As Integer Dim mszReaders(512) As Byte Dim mszGroup(512) As Byte Dim pcchReaders As Long Dim curReader As String ' if a Context is established, release it first If isContext = True Then RELCONTEXTBUTTON_Click(RELCONTEXTBUTTON, New System.EventArgs()) ' Set Scope (see Scard.bas "Scopes") dwScope = SCARD_SCOPE_USER ' Establish Context rc = SCardEstablishContext(dwScope, 0, 0, hContext) If rc <> OKERR_OK Then MESSAGETEXT.Text = (HandleError(rc)) Exit Sub End If ' Set maximum Length of mszReaders pcchReaders = 2048 ' Create a Multistring (terminated with two '\0's) mszGroup(0) = &H0 mszGroup(1) = &H0 Try rc = SCardListReaders(hContext, mszGroup(LBound(mszGroup)), mszReaders(LBound(mszReaders)), pcchReaders) Catch ex As Exception MessageBox.Show(ex.Message) End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)