i'm working on the final project in my university.
But i don't know how to connecting fingerprint tool with my application..
i have a SDK from my fingerprint tool, but it use a VB code not a C# code.
ade.julianto 0 Newbie Poster
Mike Askew 131 Veteran Poster Featured Poster
Are you sure the tool is compatible with C# then?
The producer of the fingerprint tool sadly gets to decide how you connect to their products and so if the SDK exists in VB code, then that may be the only way to do so.
What is the fingerprint tool?
ade.julianto 0 Newbie Poster
yes i'm sure..
i use the digitalpersona UareU 4500
it compatible with c#
Mike Askew 131 Veteran Poster Featured Poster
Have you tried experimenting with the provided libraries?
Their site also confirms it supports C# so you may just need to get the correct libraries.
ddanbe 2,724 Professional Procrastinator Featured Poster
ade.julianto 0 Newbie Poster
@mike askew : but the SDK is same.. the code use a VB (old version)
i can't convert the language from VB to C#.. can you convert the code i have?
Mike Askew 131 Veteran Poster Featured Poster
You're welcome to post the code, I personally haven't touched VB.Net in years so may not be able too. Someone else maybe could.
KushMishra 38 Senior Technical Lead
Hi, this one could possibly help you :-
http://converter.telerik.com/
This converts your code from VB to C# and vice-versa.After code conversion you may face some issues and then you can possibly post them here so that we may help you out with the same.
ade.julianto 0 Newbie Poster
sorry for replay..
@mike askew: this the code from SDK..
The name of the window fingerprint control is ZKFPEngX1.
At first, press Initialize button to initialize the fingerprint Sensor. If the
initialization is successful, a prompt message which indicates a success will be
shown.
The initialization code is as the following:
If ZKFPEngX1.InitEngine = 0 Then
MessageBox 0, "Initialization succeeds!", "Prompt message", 0
StatusBar.Caption = "Fingerprint Sensor connection"
TextSensorCount.Text = ZKFPEngX1.SensorCount & ""
TextSensorIndex.Text = ZKFPEngX1.SensorIndex & ""
TextSensorSN.Text = ZKFPEngX1.SensorSN
cmdInit.Enabled = False
FMatchType = 0
End If
Press the Register Fingerprint button to enter the fingerprint registration
status, and the code is like the this:
If Trim(TextFingerName.Text) = "" Then
MessageBox 0, "Please enter the fingerprint name label! ", "False", 0
Exit Sub End If
ZKFPEngX1.BeginEnroll
StatusBar.Caption = "Start registration"
At this moment, the fingerprint Sensor is under the status of registration,
and every time pressing a finger will trigger events OnImageReceived (display
images),and OnFeatureInfo(judge whether the fingerprint is qualified or not).
Pressing a finger for one or four effective times (not counting times if the finger is
unqualified) will trigger events OnEnroll and OnEnrollToFile, and the specific
pressing times number is set by the property EnrollCount. OnEnroll code is like
this :
Dim i As Long
If Not ActionResult Then
MessageBox 0, "Fingerprint registration failed! ", "Warning", 0
Else
MessageBox 0, "Fingerprint registration succeeded!", "Message", 0
FRegTemplate = ATemplate
ZKFPEngX1.SaveTemplate "c:\fingerprint.tpl", ATemplate
ZKFPEngX1.AddRegTemplateFileToFPCacheDB fpcHandle, FingerCount,
"c:\fingerprint.tpl"
ReDim Preserve FFingerNames(FingerCount + 1)
FFingerNames(FingerCount) = TextFingerName.Text
FingerCount = FingerCount + 1
End If
OnCapture code is like this:
Dim fi As Long, i As Long
Dim Score As Long, ProcessNum As Long
Dim RegChanged As Boolean
StatusBar.Caption = "capture fingerprint feature"
If FMatchType = 1 Then '1:1
If ZKFPEngX1.VerFinger(FRegTemplate, ATemplate, False, RegChanged)
Then
MessageBox 0, "Fingerprint verification succeeded! ", "Promptmessage", 0
Else
MessageBox 0, "Fingerprint verification failed! ", "Prompt message", 0
End If
'If ZKFPEngX1.VerRegFingerFile("c:\fingerprint.tpl", ATemplate) Then
' MessageBox 0, "File fingerprint verification succeeded! ", "Prompt
message", 0
'Else
' MessageBox 0, "File fingerprint verification failed! ", "Prompt
message", 0
'End If
ElseIf FMatchType = 2 Then '1:N
Score = 8
fi = ZKFPEngX1.IdentificationInFPCacheDB(fpcHandle, ATemplate, Score,
ProcessNum)
If fi = ‐1 Then
MessageBox 0, "Fingerprint verification failed!", "Prompt message", 0
Else
MessageBox 0, "Fingerprint verification succeeded ! Name=" &
FFingerNames(fi) & " Score = " & Score & " Processed Number = " &
ProcessNum, "Prompt information", 0
End If
End If
OnImageReceived event code (display fingerprint images):
ZKFPEngX1.PrintImageAt hDC, FrameCommands.Width + 6,
FrameCommands.Top, ZKFPEngX1.ImageWidth, ZKFPEngX1.ImageHeight
OnFeatureInfo event code (judge fingerprint quality): Dim sTemp As String
sTemp = ""
If ZKFPEngX1.IsRegister Then
sTemp = "registration status: press again" & ZKFPEngX1.EnrollIndex &
"time fingerprint!"
End If
sTemp = sTemp & " fingerprint quality" If
AQuality <> 0 Then
sTemp = sTemp & "Unqualified: " & AQuality
Else
sTemp = sTemp & "Qualified"
End If
StatusBar.Caption = sTemp
Mike Askew 131 Veteran Poster Featured Poster
As this is university work you should really have tried doing it with the conversion tools but I had little to do for 15 mins and was interested to see how well I could do the conversion.
It may not be 100% working if you just copy and paste in but is a start.
//The name of the window fingerprint control is ZKFPEngX1.
//At first, press Initialize button to initialize the fingerprint Sensor. If the
//initialization is successful, a prompt message which indicates a success will be
//shown.
//The initialization code is as the following:
if (ZKFPEngX1.InitEngine == 0)
{
MessageBox.Show("Initialization succeeds!", "Prompt message");
StatusBar.Caption = "Fingerprint Sensor connection";
TextSensorCount.Text = ZKFPEngX1.SensorCount & "";
TextSensorIndex.Text = ZKFPEngX1.SensorIndex & "";
TextSensorSN.Text = ZKFPEngX1.SensorSN;
cmdInit.Enabled = False;
FMatchType = 0;
}
//Press the Register Fingerprint button to enter the fingerprint registration
//status, and the code is like the this:
if (TextFingerName.Text.Trim() == "")
{
MessageBox.Show("Please enter the fingerprint name label! ", "False");
return;
}
ZKFPEngX1.BeginEnroll();
StatusBar.Caption = "Start registration";
//At this moment, the fingerprint Sensor is under the status of registration,
//and every time pressing a finger will trigger events OnImageReceived (display
//images),and OnFeatureInfo(judge whether the fingerprint is qualified or not).
//Pressing a finger for one or four effective times (not counting times if the finger is
//unqualified) will trigger events OnEnroll and OnEnrollToFile, and the specific
//pressing times number is set by the property EnrollCount. OnEnroll code is like
//this :
long i;
if (!ActionResult)
{
MessageBox.Show("Fingerprint registration failed! ", "Warning");
}
else
{
MessageBox.Show("Fingerprint registration succeeded!", "Message");
FRegTemplate = ATemplate;
ZKFPEngX1.SaveTemplate("c:\fingerprint.tpl", ATemplate);
ZKFPEngX1.AddRegTemplateFileToFPCacheDB(fpcHandle, FingerCount, "c:\fingerprint.tpl");
Preserve = FFingerNames(FingerCount + 1);
FFingerNames(FingerCount) = TextFingerName.Text;
FingerCount++;
}
//OnCapture code is like this:
long fi, i, Score, ProcessNum;
bool RegChanged;
StatusBar.Caption = "capture fingerprint feature";
if (FMatchType == 1) //1:1
{
if (ZKFPEngX1.VerFinger(FRegTemplate, ATemplate, False, RegChanged))
{
MessageBox.Show("Fingerprint verification succeeded! ", "Prompt message");
}
else
{
MessageBox.Show("Fingerprint verification failed! ", "Prompt message");
}
if (ZKFPEngX1.VerRegFingerFile("c:\fingerprint.tpl", ATemplate))
{
MessageBox.Show("File fingerprint verification succeeded! ", "Prompt message");
}
else
{
MessageBox.Show("File fingerprint verification failed! ", "Prompt message");
}
}
else if (FMatchType == 2) //1:N
{
Score = 8;
fi = ZKFPEngX1.IdentificationInFPCacheDB(fpcHandle, ATemplate, Score, ProcessNum);
if (fi == -1)
{
MessageBox.Show("Fingerprint verification failed!", "Prompt message";
}
else
{
MessageBox.Show(string.Format("Fingerprint verification succeeded ! Name={0} Score={1} Processed Number={2}", FFingerNames(fi), Score, ProcessNum), "Prompt message");
}
}
//OnImageReceived event code (display fingerprint images):
ZKFPEngX1.PrintImageAt(hDC, FrameCommands.Width + 6, FrameCommands.Top, ZKFPEngX1.ImageWidth, ZKFPEngX1.ImageHeight);
//OnFeatureInfo event code (judge fingerprint quality):
string sTemp;
sTemp = "";
if (ZKFPEngX1.IsRegister)
{
sTemp = string.Format("registration status: press again {0} time fingerprint!", ZKFPEngX1.EnrollIndex);
}
sTemp += " fingerprint quality" ;
if (AQuality <> 0)
{
sTemp = string.Format("{0} Unqualified {1}", sTemp, AQuality);
}
else
{
sTemp += " fingerprint quality" ;
}
StatusBar.Caption = sTemp;
Edited by Mike Askew
ade.julianto 0 Newbie Poster
i try in my application.. but ZKFPEngX1.InitEngine has not initialize
Mike Askew 131 Veteran Poster Featured Poster
I have no clue about how the scanner you are working with functions. So cannot help debug issues with it.
I simply did the code convert.
What error does it give?
ade.julianto 0 Newbie Poster
ZKFPEngX1 does not constrain a definition for InitEngine
i make a application with microsoft visual studio 2012 and use a project with visual C#..
Mike Askew 131 Veteran Poster Featured Poster
Forgot about this over the weekend.
You may need to play with intellisense and see what is actually available to you from the API.
Again can't offer much more help than that as don't have any knowledge of the systems you're working with myself.
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.