Prolific USB-to-Serial Fix
Prolific USB-to-Serial Fix (Official Solution to 'Code 10 error')
Posted by Alex E. on 11 March 2016 10:37 PM
|
|
Purpose of this article is to guide you on how to FIX the "Prolific USB-to-Serial" driver issue with common cheap units. In summary, this article is for: Windows XP, Windows 7, Windows 8, Windows 8.1 and Windows 10! Works on 32/64-bit. And it addresses issue of: Prolific PL-2303 Driver Fix (VID_067B&PID_2303) Driver issue will show inside your Device Manager like this:
And if you double-click on it, you will see:
Issue will also may show messages like this:
Internet is filled with pages discussing this problem — but no one seems to know what causes it. Even companies selling these USB to Serial adapters are confused. Main cause of this issue is because the device contains a counterfeit "Prolific" chip (made in China). The counterfeit chip use the same Vendor ID (VID_067B) and Product ID (PID_2303) as the authentic Prolific chips. To combat this, original Prolific company made changes to their newest drivers to render the counterfeit adapters unusable. Unfortunately this decision also renders all earlier adapters inoperative. The Prolific 64-bit drivers that Microsoft supplies via Windows Update, Versions 3.4.67.325, 3.4.25.218, 2.1.51.238, and 3.4.62.293 will not work with most adapters and therefore issues the generic "Code 10" error. Or you may get no error at all, but your device will still not work. If your adapter was working prior to going to Windows Update, you can "roll back" to the previous installed driver and all will be well once again. However, if you didn't have a previous driver installed that worked, you'll have to go through the process of removing any PL-2303 driver installation programs,the actual driver files, and the information (.INF) file, BEFORE you are able to successfully install the correct driver. What aggravates this issue is that there are many "Prolific Driver Removal Tools" that do not work properly! And Windows 8, 8.1, and Window 10 are set by default to automatically update your drivers without your permission or even notifying you of the update. So no matter how many times you remove the driver files and reboot, the next time you insert the USB-To-Serial adapter, Windows installs the newest non-working version again. Yes, it's frustrating. Only 64-bit driver I have ever found that works with all the "Prolific" adapters is Version 3.3.2.102. Below installer program will remove all of the incompatible drivers — make a change so that Windows can never update the driver without your approval — and install the Version 3.3.2.102 compatible drivers. Windows 64-bit Fix for:
Trouble Shooting:
Windows 32-bit Fix for:
Trouble Shooting:
Removal of this tool:
|
How to cut paper on POS Printer in Windows 7
My (POS) printer needs to receive the following sequence code "LPRINT CHR$(29); CHR(86); CHR$(48)" in order to activate the
paper cutter at the end of a print report.
In MS Access VBA on Windows7 64bit: goes like this:
Option Compare Database
Private Type DOCINFO
pDocName As String
pOutputFile As String
pDatatype As String
End Type
Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal _
hPrinter As Long) As Long
Private Declare Function EndDocPrinter Lib "winspool.drv" (ByVal _
hPrinter As Long) As Long
Private Declare Function EndPagePrinter Lib "winspool.drv" (ByVal _
hPrinter As Long) As Long
Private Declare Function OpenPrinter Lib "winspool.drv" Alias _
"OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, _
ByVal pDefault As Long) As Long
Private Declare Function StartDocPrinter Lib "winspool.drv" Alias _
"StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, _
pDocInfo As DOCINFO) As Long
Private Declare Function StartPagePrinter Lib "winspool.drv" (ByVal _
hPrinter As Long) As Long
Private Declare Function WritePrinter Lib "winspool.drv" (ByVal _
hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, _
pcWritten As Long) As Long
Function PrinterPaperCut()
Dim lhPrinter As Long
Dim lReturn As Long
Dim lpcWritten As Long
Dim lDoc As Long
Dim sWrittenData As String
Dim MyDocInfo As DOCINFO
lReturn = OpenPrinter("XP-80", lhPrinter, 0)
If lReturn = 0 Then
MsgBox "The Printer Name you typed wasn't recognized."
Exit Function
End If
MyDocInfo.pDocName = "KassaPrinter"
MyDocInfo.pOutputFile = vbNullString
MyDocInfo.pDatatype = vbNullString
lDoc = StartDocPrinter(lhPrinter, 1, MyDocInfo)
Call StartPagePrinter(lhPrinter)
sWrittenData = ""
For n = 1 To 0
sWrittenData = vbFormFeed & vbFormFeed
Next n
sWrittenData = sWrittenData + Chr$(29) & Chr$(86) & Chr$(48)
'sWrittenData = sWrittenData + Chr$(29) & Chr$(86) & Chr$(1) & Chr$(0) & Chr$(10) & Chr$(10) & Chr$(0) & vbFormFeed
lReturn = WritePrinter(lhPrinter, ByVal sWrittenData, _
Len(sWrittenData), lpcWritten)
lReturn = EndPagePrinter(lhPrinter)
lReturn = EndDocPrinter(lhPrinter)
lReturn = ClosePrinter(lhPrinter)
End Function
eID Reader
Code examples that worked before on Ms Access 2010 on Windows 7 before update to eID-QuickInstaller-407-7466-signed_tcm227-258853.exe
info:
https://code.google.com/p/eid-mw/
In je VBA project moet je bij verwijzingen de "beidlibaxctrl 1.1 Type Library" aanvinken, die zul je pas vinden in je systeem na het installeren van de BEId Middelware software (35Mb) of runtime (13 of 12 Mb) en herstarten van je PC.
http://www.helpmij.nl/forum/showthread.php/598653-Belgian-identity-card-uitlezen
Option Compare Database
Private Sub cmdEID_Click() Dim EIDlib1 As New EIDLIBCTRLLib.EIDlib 'BEID_ Kaart Info strName = MapColID.GetValue("Name") strStreet = MapColAddress.GetValue("Street") Exit_cmdEID_Click: Private Sub cmdVerwijderen_Click() Dim db As Database DoCmd.SetWarnings True Err_cmdVerwijderen_Click: |
|
Sub TestEID() ' ' TestEID Macro ' ' Dim EIDlib1 As New EIDLIBCTRLLib.EIDlib Dim lhandle As Long Dim RetStatus As New EIDLIBCTRLLib.RetStatus Dim MapColPicture As New EIDLIBCTRLLib.MapCollection Dim MapColID As New EIDLIBCTRLLib.MapCollection Dim MapColAddress As New EIDLIBCTRLLib.MapCollection Dim CertifCheck As New EIDLIBCTRLLib.CertifCheck Dim strName As String Dim strFirstName1 As String Dim strBirthPlace As String Dim strBirthDate As String Dim strGender As String Dim strNationality As String Dim strNationalNumber As String Dim strStreet As String Dim strZipcode As String Dim strMunicipality As String Dim Pasfoto_Temp As Variant Set RetStatus = EIDlib1.Init("", 0, 0, lhandle) Set RetStatus = EIDlib1.GetID(MapColID, CertifCheck) strName = MapColID.GetValue("Name") strFirstName1 = MapColID.GetValue("FirstName1") strBirthDate = MapColID.GetValue("BirthDate") strBirthPlace = MapColID.GetValue("BirthPlace") strGender = MapColID.GetValue("Gender") strNationality = MapColID.GetValue("Nationality") strNationalNumber = MapColID.GetValue("NationalNumber") Set RetStatus = EIDlib1.GetAddress(MapColAddress, CertifCheck) strStreet = MapColAddress.GetValue("Street") strZipcode = MapColAddress.GetValue("ZIPCode") strMunicipality = MapColAddress.GetValue("Municipality") Set RetStatus = EIDlib1.GetPicture(MapColPicture, CertifCheck) Pasfoto_Temp = MapColPicture.GetValue("Picture") Set RetStatus = EIDlib1.Exit MsgBox strName & ", " & strFirstName1 & vbCrLf & _ strStreet & vbCrLf & _ strZipcode & " " & strMunicipality & vbCrLf, vbOKOnly End Sub |
|
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
' Written by Sylvain Kusters
' Free to use to everyone
' If you come with better solution (quicker) please let me also profit from your code.
' Dit e-mailadres wordt beveiligd tegen spambots. JavaScript dient ingeschakeld te zijn om het te bekijken.
' Visit also www.filmclub.info
Dim lHandle As Integer
'BEID_ Kaart Info
Dim strCardNumber As String
Dim strBegValDag, strBegVal, strBegValMaand As Object
Dim strBegValJaar As String
Dim strEndValDag, strEndVal, strEndValMaand As Object
Dim strEndValJaar As String
Dim strIssuingMunicipality As String
'BEID Persoons Info
Dim strName As String
Dim strFirstName1 As String
Dim strBirthPlace As String
Dim strBirthDate As String
Dim strGender As String
Dim strNationality As String
Dim strNationalNumber As String
'BEID Adres Info
Dim strStreet As String
Dim strZIPCode As String
Dim strMunicipality As String
'BEID PICTURE
Dim PictureFileName As String
Dim FirstPath As String
Dim EndPath As String
Dim Path As String
Dim RetStatus As EIDLIBCTRLLib.RetStatus
Dim MapColPicture As New EIDLIBCTRLLib.MapCollection
Dim MapColID As New EIDLIBCTRLLib.MapCollection
Dim MapColAddress As New EIDLIBCTRLLib.MapCollection
Dim CertifCheck As New EIDLIBCTRLLib.CertifCheck
RetStatus = EIDlib1.Init("", 0, 0, lHandle)
If (RetStatus.GetGeneral = 0) Then
RetStatus = EIDlib1.GetID(MapColID, CertifCheck)
strChipNumber = MapColID.GetValue("ChipNumber")
strCardNumber = MapColID.GetValue("CardNumber")
strBegVal = MapColID.GetValue("BeginValidityDate")
strEndVal = MapColID.GetValue("EndValidityDate")
strIssuingMunicipality = MapColID.GetValue("IssuingMunicipality")
strName = MapColID.GetValue("Name")
strFirstName1 = MapColID.GetValue("FirstName1")
strBirthDate = MapColID.GetValue("BirthDate")
strBirthPlace = MapColID.GetValue("BirthPlace")
strGender = MapColID.GetValue("Gender")
strNationality = MapColID.GetValue("Nationality")
strNationalNumber = MapColID.GetValue("NationalNumber")
'Opsplitsen begindatum
strBegValDag = VB.Right(strBegVal, 2)
strBegValMaand = Mid(strBegVal, 5, 2)
strBegValJaar = VB.Left(strBegVal, 4)
'Opsplitsen einddatum
strEndValDag = VB.Right(strEndVal, 2)
strEndValMaand = Mid(strEndVal, 5, 2)
strEndValJaar = VB.Left(strEndVal, 4)
txtbxCardNumber.Text = strCardNumber
txtbxBeginValidityDate.Text = strBegValDag & "/" & strBegValMaand & "/" & strBegValJaar
txtbxEndValidityDate.Text = strEndValDag & "/" & strEndValMaand & "/" & strEndValJaar
txtbxIssuingMunicipality.Text = strIssuingMunicipality
txtbxName.Text = strName
txtbxFirstName1.Text = strFirstName1
txtbxBirthDate.Text = strBirthDate
txtbxBirthPlace.Text = strBirthPlace
txtbxGender.Text = strGender
txtbxNationality.Text = strNationality
txtbxNationalNumber.Text = strNationalNumber
End If
RetStatus = EIDlib1.GetAddress(MapColAddress, CertifCheck)
strStreet = MapColAddress.GetValue("Street")
strZIPCode = MapColAddress.GetValue("ZIPCode")
strMunicipality = MapColAddress.GetValue("Municipality")
txtbxStreet.Text = strStreet
txtbxZIPCode.Text = strZIPCode
txtbxMunicipality.Text = strMunicipality
' Picture inladen
FirstPath = "(unknown)_BELPIC_"
EndPath = "_4035"
Path = "c:\Documents and settings\gebruiker\eid-cache"
PictureFileName = FirstPath & strChipNumber & EndPath
RetStatus = EIDlib1.GetPicture(MapColPicture, CertifCheck)
Picture1.Image = System.Drawing.Image.FromFile(Path & "\" & PictureFileName)
RetStatus = EIDlib1.Exit()
End Sub
|
|
this is the code (working) for excel: Option Explicit '--------------------------------------------------------------------------------------- ' Procedure : TestEID ' Author : Charlizenne ... and the website with e-id info ' Date : 19/06/2010 ' Purpose : read info from passport-chip with cardreader ' the e-id software needs to be installed because you need a reference ' to beidlibaxctrl 1.1 type '--------------------------------------------------------------------------------------- ' Sub TestEID() ' ' TestEID Macro ' ' You need to make a reference to * beidlibaxctrl 1.1 type * library ' it's on your system if you install the e-id software ' Dim EIDlib1 As New EIDLIBCTRLLib.EIDlib Dim lhandle As Long Dim RetStatus As New EIDLIBCTRLLib.RetStatus Dim MapColPicture As New EIDLIBCTRLLib.MapCollection Dim MapColID As New EIDLIBCTRLLib.MapCollection Dim MapColAddress As New EIDLIBCTRLLib.MapCollection Dim CertifCheck As New EIDLIBCTRLLib.CertifCheck Dim strName As String Dim strFirstName1 As String Dim strBirthPlace As String Dim strBirthDate As String Dim strGender As String Dim strNationality As String Dim strNationalNumber As String Dim strStreet As String Dim strZipcode As String Dim strMunicipality As String 'this one holds the picture data in byte format Dim Pasfoto_Temp() As Byte 'this one is the path for saving the picture Dim mypathfoto As String mypathfoto = "c:\temp\" Set RetStatus = EIDlib1.Init("", 0, 0, lhandle) If lhandle = 0 Then MsgBox "Please insert your id-card ...", vbOKOnly, "Reading id-card ..." Set RetStatus = EIDlib1.Exit Exit Sub End If Set RetStatus = EIDlib1.GetID(MapColID, CertifCheck) strName = MapColID.GetValue("Name") strFirstName1 = MapColID.GetValue("FirstName1") strBirthDate = MapColID.GetValue("BirthDate") strBirthPlace = MapColID.GetValue("BirthPlace") strGender = MapColID.GetValue("Gender") strNationality = MapColID.GetValue("Nationality") strNationalNumber = MapColID.GetValue("NationalNumber") Set RetStatus = EIDlib1.GetAddress(MapColAddress, CertifCheck) strStreet = MapColAddress.GetValue("Street") strZipcode = MapColAddress.GetValue("ZIPCode") strMunicipality = MapColAddress.GetValue("Municipality") Set RetStatus = EIDlib1.GetPicture(MapColPicture, CertifCheck) Pasfoto_Temp = MapColPicture.GetValue("Picture") 'here we pass the array of the picture to the function PictureFromRes 'and save it on the hard drive with the nationalnumber as filename 'I suppose this one is unique for everyone SavePicture PictureFromRes(Pasfoto_Temp), mypathfoto & strNationalNumber & ".jpg" Set RetStatus = EIDlib1.Exit With ActiveWorkbook.ActiveSheet .Cells(1, 2).Value = strName .Cells(2, 2).Value = strFirstName1 .Cells(3, 2).Value = strBirthDate .Cells(4, 2).Value = strBirthPlace .Cells(5, 2).Value = strGender .Cells(6, 2).Value = strNationality .Cells(7, 2).Value = strNationalNumber .Cells(8, 2).Value = strStreet .Cells(9, 2).Value = strZipcode .Cells(10, 2).Value = strMunicipality .Cells(1, 3).Select .Pictures.Insert mypathfoto & strNationalNumber & ".jpg" .Cells(1, 1).Select End With End Sub this is supposebly the code for VBA acces: Sub TestEID() ' ' TestEID Macro ' ' Dim EIDlib1 As New EIDLIBCTRLLib.EIDlib Dim lhandle As Long Dim RetStatus As New EIDLIBCTRLLib.RetStatus Dim MapColPicture As New EIDLIBCTRLLib.MapCollection Dim MapColID As New EIDLIBCTRLLib.MapCollection Dim MapColAddress As New EIDLIBCTRLLib.MapCollection Dim CertifCheck As New EIDLIBCTRLLib.CertifCheck Dim strName As String Dim strFirstName1 As String Dim strBirthPlace As String Dim strBirthDate As String Dim strGender As String Dim strNationality As String Dim strNationalNumber As String Dim strStreet As String Dim strZipcode As String Dim strMunicipality As String Dim Pasfoto_Temp As Variant Set RetStatus = EIDlib1.Init("", 0, 0, lhandle) Set RetStatus = EIDlib1.GetID(MapColID, CertifCheck) strName = MapColID.GetValue("Name") strFirstName1 = MapColID.GetValue("FirstName1") strBirthDate = MapColID.GetValue("BirthDate") strBirthPlace = MapColID.GetValue("BirthPlace") strGender = MapColID.GetValue("Gender") strNationality = MapColID.GetValue("Nationality") strNationalNumber = MapColID.GetValue("NationalNumber") Set RetStatus = EIDlib1.GetAddress(MapColAddress, CertifCheck) strStreet = MapColAddress.GetValue("Street") strZipcode = MapColAddress.GetValue("ZIPCode") strMunicipality = MapColAddress.GetValue("Municipality") Set RetStatus = EIDlib1.GetPicture(MapColPicture, CertifCheck) Pasfoto_Temp = MapColPicture.GetValue("Picture") Set RetStatus = EIDlib1.Exit MsgBox strName & ", " & strFirstName1 & vbCrLf & _ strStreet & vbCrLf & _ strZipcode & " " & strMunicipality & vbCrLf, vbOKOnly End Sub |
|
'EIDLIBCTRLLib Public Class Form1 Private Sub btnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click 'Close the application Me.Close() Application.Exit() End Sub Private Sub btnRead_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRead.Click 'Open the File dialog and save the file name Me.dlgopenFile.Filter = "Eid files (*.eid)|*.eid" Me.dlgopenFile.FileName = "" If Me.dlgopenFile.ShowDialog() <> Windows.Forms.DialogResult.OK Then Return End If Me.txtPath.Text = Me.dlgopenFile.FileName 'Read the File, parse it, then fill the rawData structure and get the field value If Not System.IO.File.Exists(Me.txtPath.Text) Then MessageBox.Show("File does not exist!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Return End If Dim FullCOntent As Byte() FullCOntent = System.IO.File.ReadAllBytes(Me.txtPath.Text) 'Parse the file and fill the raw structure Dim raw As New EIDLIBCTRLLib.Raw ParseFile(FullCOntent, raw) Dim lhandle As Long Dim retStatus As EIDLIBCTRLLib.RetStatus Dim eidlib As New EIDLIBCTRLLib.EIDlib retStatus = eidlib.Init("VIRTUAL", 0, 0, lhandle) Dim MapColID As New EIDLIBCTRLLib.MapCollection Dim MapColAddress As New EIDLIBCTRLLib.MapCollection Dim MapColPicture As New EIDLIBCTRLLib.MapCollection Dim CertifCheck As New EIDLIBCTRLLib.CertifCheck 'Set the raw structure into the virtual reader retStatus = eidlib.SetRawData(raw) If (retStatus.GetGeneral <> 0) Then MessageBox.Show("Bad file format.", "Error : " & retStatus.GetGeneral, MessageBoxButtons.OK, MessageBoxIcon.Error) eidlib.Exit() Return End If 'Get the field Value retStatus = eidlib.GetID(MapColID, CertifCheck) If (retStatus.GetGeneral = 0) Then Me.txtName.Text = ConvertCodePage(MapColID.GetValue("Name")) Me.txtFirstName.Text = ConvertCodePage(MapColID.GetValue("FirstName1")) Else MessageBox.Show("Bad file format.", "Error : " & retStatus.GetGeneral, MessageBoxButtons.OK, MessageBoxIcon.Error) eidlib.Exit() Return End If retStatus = eidlib.GetAddress(MapColAddress, CertifCheck) If (retStatus.GetGeneral = 0) Then Me.txtStreet.Text = ConvertCodePage(MapColAddress.GetValue("Street")) Me.txtZip.Text = ConvertCodePage(MapColAddress.GetValue("ZIPCode")) Me.txtCity.Text = ConvertCodePage(MapColAddress.GetValue("Municipality")) Else MessageBox.Show("Bad file format.", "Error : " & retStatus.GetGeneral, MessageBoxButtons.OK, MessageBoxIcon.Error) eidlib.Exit() Return End If Dim picture As Byte() = Nothing Dim photo As Image retStatus = eidlib.GetPicture(MapColPicture, CertifCheck) If (retStatus.GetGeneral = 0) Then picture = MapColPicture.GetValue("Picture") Dim ms As System.IO.MemoryStream ms = New System.IO.MemoryStream() ms.Write(picture, 0, picture.Length) photo = Image.FromStream(ms, True) Me.imgPicture.Image = photo Else MessageBox.Show("Bad file format.", "Error : " & retStatus.GetGeneral, MessageBoxButtons.OK, MessageBoxIcon.Error) eidlib.Exit() Return End If eidlib.Exit() End Sub Private Sub ParseFile(ByVal FullCOntent As Byte(), ByRef raw As EIDLIBCTRLLib.Raw) Dim FileContent As Byte() = Nothing 'File ID FileContent = GetTagValue(FullCOntent, 1) raw.SetIDData(FileContent) 'File Sig ID FileContent = GetTagValue(FullCOntent, 2) raw.SetIDSigData(FileContent) 'File Address FileContent = GetTagValue(FullCOntent, 3) raw.SetAddrData(FileContent) 'File Sig Address FileContent = GetTagValue(FullCOntent, 4) raw.SetAddrSigData(FileContent) 'File Picture FileContent = GetTagValue(FullCOntent, 5) raw.SetPictureData(FileContent) 'File CardData FileContent = GetTagValue(FullCOntent, 6) raw.SetCardData(FileContent) 'File TokenInfo FileContent = GetTagValue(FullCOntent, 7) raw.SetTokenInfoData(FileContent) 'File RN FileContent = GetTagValue(FullCOntent, 8) raw.SetRNData(FileContent) 'File Challenge FileContent = GetTagValue(FullCOntent, 9) raw.SetChallengeData(FileContent) 'File Response FileContent = GetTagValue(FullCOntent, 10) raw.SetResponseData(FileContent) End Sub Private Function GetTagValue(ByVal FullContent As Byte(), ByVal TagID As Int32) As Byte() Dim result As Byte() = Nothing Dim bStop As Boolean = False Dim bFound As Boolean = False Dim count As Int32 Dim i As Int32 Dim CurrentTagID As Int32 Dim CurrentTagLength As Int32 count = 0 Do If count >= FullContent.Length() Then bStop = True Else CurrentTagID = FullContent(count) CurrentTagLength = 0 Do count += 1 CurrentTagLength = CurrentTagLength * 128 + FullContent(count) Mod 128 Loop While (FullContent(count) > 128) End If count += 1 If TagID = CurrentTagID Then If count + CurrentTagLength - 1 < FullContent.Length() Then bFound = True End If bStop = True Else count += CurrentTagLength End If Loop Until (bStop) If bFound Then ReDim result(CurrentTagLength - 1) For i = 0 To CurrentTagLength - 1 result(i) = FullContent(count + i) Next Return result End If MessageBox.Show("Bad file format.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Return Nothing End Function Function ConvertCodePage(ByVal strSrc As String) As String Const CP_UTF8 = 65001 Const CP_WIN = 1252 Dim bytesSrc As Byte() = System.Text.Encoding.UTF8.GetBytes(strSrc) 'Define the encoding Dim encodingSrc As System.Text.Encoding = System.Text.Encoding.GetEncoding(CP_UTF8) Dim encodingDest As System.Text.Encoding = System.Text.Encoding.GetEncoding(CP_WIN) 'Convert the data To destination code page/charset Dim bytesDest As Byte() = System.Text.Encoding.Convert(encodingSrc, encodingDest, bytesSrc) Dim strDest As String = System.Text.Encoding.UTF8.GetString(bytesDest) Return strDest End Function End Class |
|
Private Sub btnReadEid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReadEid.Click Dim lHandle As Integer 'BEID_ Kaart Info Dim strCardNumber As String Dim strChipNumber As String Dim strBegValDag, strBegVal, strBegValMaand As Object Dim strBegValJaar As String Dim strEndValDag, strEndVal, strEndValMaand As Object Dim strEndValJaar As String Dim strIssuingMunicipality As String 'BEID Persoons Info Dim strName As String Dim strFirstName1 As String Dim strBirthPlace As String Dim strBirthDate As String Dim strGender As String Dim strNationality As String Dim strNationalNumber As String 'BEID Adres Info Dim strStreet As String Dim strZIPCode As String Dim strMunicipality As String Dim RetStatus As EIDLIBCTRLLib.RetStatus Dim MapColPicture As New EIDLIBCTRLLib.MapCollection Dim MapColID As New EIDLIBCTRLLib.MapCollection Dim MapColAddress As New EIDLIBCTRLLib.MapCollection Dim CertifCheck As New EIDLIBCTRLLib.CertifCheck 'voor de img Dim bytes() As Byte 'Dim ms As System.IO.MemoryStream() Try RetStatus = EIDlib1.Init("", 0, 0, lHandle) If (RetStatus.GetGeneral = 0) Then RetStatus = EIDlib1.GetID(MapColID, CertifCheck) strChipNumber = MapColID.GetValue("ChipNumber").ToString strCardNumber = MapColID.GetValue("CardNumber").ToString strBegVal = MapColID.GetValue("BeginValidityDate") strEndVal = MapColID.GetValue("EndValidityDate") strIssuingMunicipality = MapColID.GetValue("IssuingMunicipality").ToString strName = MapColID.GetValue("Name").ToString strFirstName1 = MapColID.GetValue("FirstName1").ToString strBirthDate = MapColID.GetValue("BirthDate").ToString strBirthPlace = MapColID.GetValue("BirthPlace").ToString strGender = MapColID.GetValue("Gender").ToString strNationality = MapColID.GetValue("Nationality").ToString strNationalNumber = MapColID.GetValue("NationalNumber").ToString 'Opsplitsen begindatum strBegValDag = VB.Right(strBegVal.ToString, 2) strBegValMaand = Mid(strBegVal.ToString, 5, 2) strBegValJaar = VB.Left(strBegVal.ToString, 4) 'Opsplitsen einddatum strEndValDag = VB.Right(strEndVal.ToString, 2) strEndValMaand = Mid(strEndVal.ToString, 5, 2) strEndValJaar = VB.Left(strEndVal.ToString, 4) End If RetStatus = EIDlib1.GetAddress(MapColAddress, CertifCheck) strStreet = MapColAddress.GetValue("Street").ToString strZIPCode = MapColAddress.GetValue("ZIPCode").ToString strMunicipality = MapColAddress.GetValue("Municipality").ToString lblName.Text = strName lblFirstName.Text = strFirstName1 lblBirthplace.Text = strBirthPlace lblBirthDate.Text = strBirthDate lblGender.Text = strGender lblNat.Text = strNationality lblNatNr.Text = strNationalNumber lblStreet.Text = strStreet lblPostCode.Text = strZIPCode lblGemeente.Text = strMunicipality lblLand.Text = "België" lblChipNr.Text = strChipNumber lblCardNr.Text = strCardNumber lblBegVal.Text = strBegVal.ToString lblEndVal.Text = strEndVal.ToString lblUitreikGemeente.Text = strIssuingMunicipality RetStatus = EIDlib1.GetPicture(MapColPicture, CertifCheck) bytes = DirectCast(MapColPicture.GetValue("Picture"), Byte()) 'ms = DirectCast(bytes, System.IO.MemoryStream) Dim ms As New System.IO.MemoryStream(bytes) PbFoto.Image = System.Drawing.Image.FromStream(ms) deelnemer = New EidData(strCardNumber, strChipNumber, strBegValDag, strBegVal, strBegValMaand, strBegValJaar, strEndValDag, strEndVal, strEndValMaand, strEndValJaar, strIssuingMunicipality, strName, strFirstName1, strBirthPlace, strBirthDate, strGender, strNationality, strNationalNumber, strStreet, strZIPCode, strMunicipality, bytes) kaartGelezen = 1 Catch ex As Exception MsgBox(ex.ToString) End Try End Sub |