 |
|
ติดปัญหาการ select ข้อมูลรหัสลายนิ้วมือ ฐานข้อมุล MySQL + VB2012 |
|
 |
|
|
 |
 |
|
อยากจะช่วย แต่พอเจอรูปภาพ ก็ขี้เกียจขึ้นมาทันทีครับ
แก้เป็น text ครับ เดียวจะเข้ามาช่วย(ถ้ามี text ให้ก๊อป)
|
 |
 |
 |
 |
Date :
2014-11-14 13:19:00 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้โค๊ดตัวอย่างในส่วนของค้นหาข้อมูลโดยใช้ MS Access เอามาจากโปรแกรมตัวอย่างครับ
Code (VB.NET)
' อ่านข้อมูลลายนิ้วมือจากฐานข้อมูล
Private Sub AddFinger()
Dim sTemp As String
'Dim strDataSourcePath As String
Dim rsSelect As New ADODB.Recordset
DataBasePath = My.Application.Info.DirectoryPath
Conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataBasePath & "\dbFingerprint.mdb;Persist Security Info=False")
FingerCount = 0
fpcHandle = ZKFPEngX1.CreateFPCacheDB
rsSelect.Open("Select * from us_userinfo", Conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
rsSelect.MoveFirst()
While Not rsSelect.EOF
sTemp = rsSelect.Fields("fpstring").Value
ZKFPEngX1.AddRegTemplateStrToFPCacheDB(fpcHandle, FingerCount, sTemp)
ReDim Preserve FFingerCode(FingerCount + 1)
ReDim Preserve FFingerNames(FingerCount + 1)
ReDim Preserve FFingerPic(FingerCount + 1)
If rsSelect.Fields("code").Value <> "" Then
FFingerCode(FingerCount) = rsSelect.Fields("code").Value
Else
FFingerCode(FingerCount) = ""
End If
If rsSelect.Fields("name").Value <> "" Then
FFingerNames(FingerCount) = rsSelect.Fields("name").Value
Else
FFingerNames(FingerCount) = ""
End If
If rsSelect.Fields("pic").Value <> "" Then
FFingerPic(FingerCount) = rsSelect.Fields("pic").Value
Else
FFingerPic(FingerCount) = ""
End If
FingerCount = FingerCount + 1
rsSelect.MoveNext()
End While
rsSelect.Close()
End Sub
ไฟล์ทั้งหมด ตัวอย่างและ SDK ผมแนบไฟล์ไว้ที่
https://drive.google.com/folderview?id=0BwK3L4J8YBbgb2JPbVlTcUVkQk0&usp=sharing
ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2014-11-14 13:58:52 |
By :
thanabordees93 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้เป็นตัวอย่างที่ ดึงมาเปรียบเทียบ และตัวอย่างที่เซฟ ลายนิ้วมือ มีไหมครับ
หรือว่าอยู่ใน Fingerpirnt.zip ครับ อันนั้นเห็นเป็น โปรแกรม
|
 |
 |
 |
 |
Date :
2014-11-14 14:19:19 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใน FingerPrint.ZIP มันเป้นตัวอย่างทั้งโปรแกรมเลยครับ แต่เป้นของเดิมที่เค้าใช้ MS Access
ผมเอามาแปลงเป็นบันทึกเป็น MySQL แล้ว คีย์รหัสลายนิ้วมือเป็น Fpstring รูปแบบเดียวกับในตัวอย่าง
ส่วนโค๊ดค้นหาเปรียบเทียบผมเห็นมีอยู่แค่อันนี้ครับ เป้นของ MS Access ผมทำให้มันเป้น MySQL ไม่ถูก
Code (VB.NET)
' อ่านข้อมูลลายนิ้วมือจากฐานข้อมูล
Private Sub AddFinger()
Dim sTemp As String
'Dim strDataSourcePath As String
Dim rsSelect As New ADODB.Recordset
DataBasePath = My.Application.Info.DirectoryPath
Conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataBasePath & "\dbFingerprint.mdb;Persist Security Info=False")
FingerCount = 0
fpcHandle = ZKFPEngX1.CreateFPCacheDB
rsSelect.Open("Select * from us_userinfo", Conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
rsSelect.MoveFirst()
While Not rsSelect.EOF
sTemp = rsSelect.Fields("fpstring").Value
ZKFPEngX1.AddRegTemplateStrToFPCacheDB(fpcHandle, FingerCount, sTemp)
ReDim Preserve FFingerCode(FingerCount + 1)
ReDim Preserve FFingerNames(FingerCount + 1)
ReDim Preserve FFingerPic(FingerCount + 1)
If rsSelect.Fields("code").Value <> "" Then
FFingerCode(FingerCount) = rsSelect.Fields("code").Value
Else
FFingerCode(FingerCount) = ""
End If
If rsSelect.Fields("name").Value <> "" Then
FFingerNames(FingerCount) = rsSelect.Fields("name").Value
Else
FFingerNames(FingerCount) = ""
End If
If rsSelect.Fields("pic").Value <> "" Then
FFingerPic(FingerCount) = rsSelect.Fields("pic").Value
Else
FFingerPic(FingerCount) = ""
End If
FingerCount = FingerCount + 1
rsSelect.MoveNext()
End While
rsSelect.Close()
End Sub
|
 |
 |
 |
 |
Date :
2014-11-14 14:27:36 |
By :
thanabordees93 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
การเปลี่ยน Access เป็น Mysql
1. Export Access ออกมาเป็น .sql
2. Import .sql นั้นใส่ลงใน Mysql หรือ จะ Import Data base จาก ไฟล์ Access เลยก็ได้
3. ในส่วนของของโค้ด เปลียนจาก OleDB เป็น Mysql (คือเปลี่ยนคำว่า OleDB เป็น MySQL ในทุกส่วนของโค้ดอะ)
4. เปลี่ยน Connection string จาก
Code (VB Code)
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataBasePath & "\dbFingerprint.mdb;Persist Security Info=False"
ให้เป็น
Code (VB Code)
"Persist Security Info=False;database=dbname;server=ip เครื่องที่ลง mysql;Connect Timeout=30;Port=3306;CharSet=utf8;user id=UID;Password=password"
เงื่อนไขให้ค้นหาที่เหมือนกัน 5 จุดเพื่อยืนยันตัวบุคคลใช่ไหมครับ ลองใช้ Like '%%' เชื่อมเงื่อนไข ด้วย And 5 ครั้งได้ไหมครับ อันนี้ผมคิดเฉยๆนะครับ ผมไม่ทราบเหมือนกันว่า 1000 ตัวอักษรที่ว่านี้ มีทั้งหมดกี่จุด และ แต่ละจุดมีกี่ตัวอักษร คุณลองแสกนนิ้วของคุณ ซัก 10 ครั้งแล้วเอา รหัสที่ได้มาดูเทียบกันซักสิบครั้งดูครับ ว่ามันเปลี่ยนตรงไหนบ้าง จะได้ตั้งเงื่อนไขถูก
ปล. มีซอร์ดโค้ดโปรแกรมตัวอย่างแล้วโปรแกรมตัวอย่างนั้น เค้าไม่มีปุ่มค้นหามาให้หรอครับ
|
ประวัติการแก้ไข 2014-11-15 01:32:52
 |
 |
 |
 |
Date :
2014-11-15 01:32:28 |
By :
zarooman |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
Public Class Form1
Dim con As MySql.Data.MySqlClient.MySqlConnection
Dim cmd As MySql.Data.MySqlClient.MySqlCommand
Dim rsSelect As MySql.Data.MySqlClient.MySqlDataReader
Dim sTemp As String
Dim StatusAdd As Integer
Dim FTempLen As Integer
Dim FRegTemplate As Object
Dim FingerCount As Long
Dim fpcHandle As Long
Dim FFingerCode() As String 'รหัส
Dim FFingerNames() As String 'ชื่อ
Dim FFingerPic() As String 'รูป
Dim FMatchType As Integer
Dim ItemFinger As String 'ลายนิ้ว
Dim ItemPathNoPic As String 'ไม่มีรูป
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
con = New MySql.Data.MySqlClient.MySqlConnection(
"server=localhost;user id=test;Password=test;database=test;persist security info=False")
cmd = New MySql.Data.MySqlClient.MySqlCommand()
cmd.Connection = con 'this.msqlConnection;
cmd.CommandText = "SELECT * FROM us_userinfo"
Try
FingerCount = 0
'fpcHandle = ZKFPEngX1.CreateFPCacheDB
con.Open()
rsSelect = cmd.ExecuteReader()
While rsSelect.Read()
sTemp = rsSelect.GetString("fpstring")
'ZKFPEngX1.AddRegTemplateStrToFPCacheDB(fpcHandle, FingerCount, sTemp)
ReDim Preserve FFingerCode(FingerCount + 1)
ReDim Preserve FFingerNames(FingerCount + 1)
ReDim Preserve FFingerPic(FingerCount + 1)
If rsSelect.GetString("code") <> "" Then
FFingerCode(FingerCount) = rsSelect.GetString("code")
Else
FFingerCode(FingerCount) = ""
End If
If rsSelect.GetString("name") <> "" Then
FFingerNames(FingerCount) = rsSelect.GetString("name")
Else
FFingerNames(FingerCount) = ""
End If
If rsSelect.GetString("pic") <> "" Then
FFingerPic(FingerCount) = rsSelect.GetString("pic")
Else
FFingerPic(FingerCount) = ""
End If
FingerCount = FingerCount + 1
End While
Catch er As Exception
'do something with the exception
Finally
con.Close()
End Try
End Sub
End Class
ลองดูนะครับ แต่ผมอ่าน โค๊ดแล้วงง ไม่รู้ว่าพอหาเจอแล้ว มันจะแสดงข้อมูลยังไง
คือไม่เห็นตัว เปรียบเทียบว่า เหมือน แล้ว ให้หยุด
เอาเป็นว่าส่วนนั้นคงทำได้เองนะครับ อันนี้ก็แค่เอาส่วนที่แปลง จาก access เป็น mysql ก็แล้วกันนะครับ
อ้อ ในส่วน remark เป็นส่วนของ dll ผมขึ้เกียจหา function add dll นะครับ คิดว่าคุณคงมีแล้ว
เวลาใช้ ก็เอา มาร์คออก ด้วยนะครับ และผม ไม่ได้ทำประกาศไว้ คิดว่าคงทำได้เองแหล่ะครับ
|
 |
 |
 |
 |
Date :
2014-11-15 10:40:45 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สอบถามหน่อยครับ เรื่องติดต่อกับเครื่องแสกน ลายนิ้วมือ ผมลองทำตามดูแต่ ไม่ยังขึ้น error ฟัง dll
ดูข้อมูล เก็บลายนิ้วมือ ยังไงครับ ช่วยแนะนำหน่อยครับ พวก sdk ต้องมี ลายเส้นไหม คุณ thanabordees93
[email protected]
|
 |
 |
 |
 |
Date :
2016-05-19 16:02:33 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณ Chaidhanan ช่วยแนะนำด้วยครับ
|
 |
 |
 |
 |
Date :
2016-05-19 16:05:02 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2016-06-14 10:28:25 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
'ผม ก็ add reference แล้วนะครับ แต่มันขึ้นเครื่องหมาย ตกใจ ! ตามภาพ ที่อยู่ขวามือ imports ไม่ครบหรือครับ แก้ไขยัง ไงครับ
' ช่วยทีครับผม
Imports AxZKFPEngXControl
Imports ZKFPEngXControl
Imports System.Runtime.InteropServices
Public Class Form1
Dim con As MySql.Data.MySqlClient.MySqlConnection
Dim cmd As MySql.Data.MySqlClient.MySqlCommand
Dim rsSelect As MySql.Data.MySqlClient.MySqlDataReader
Dim sTemp As String
Dim StatusAdd As Integer
Dim FTempLen As Integer
Dim FRegTemplate As Object
Dim FingerCount As Long
Dim fpcHandle As Long
Dim FFingerCode() As String 'รหัส
Dim FFingerNames() As String 'ชื่อ
Dim FFingerPic() As String 'รูป
Dim FMatchType As Integer
Dim ItemFinger As String 'ลายนิ้ว
Dim ItemPathNoPic As String 'ไม่มีรูป
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con = New MySql.Data.MySqlClient.MySqlConnection("server=localhost;user id=root;Password=34260;database=test;persist security info=False")
cmd = New MySql.Data.MySqlClient.MySqlCommand()
cmd.Connection = con 'this.msqlConnection;
cmd.CommandText = "SELECT * FROM us_userinfo"
Try
FingerCount = 0
'fpcHandle = ZKFPEngX1.CreateFPCacheDB
con.Open()
rsSelect = cmd.ExecuteReader()
While (rsSelect.Read())
sTemp = rsSelect.GetString("fpstring")
'ZKFPEngX1.AddRegTemplateStrToFPCacheDB(fpcHandle, FingerCount, sTemp)
ReDim Preserve FFingerCode(FingerCount + 1)
ReDim Preserve FFingerNames(FingerCount + 1)
ReDim Preserve FFingerPic(FingerCount + 1)
If rsSelect.GetString("code") <> "" Then
FFingerCode(FingerCount) = rsSelect.GetString("code")
Else
FFingerCode(FingerCount) = ""
End If
If rsSelect.GetString("name") <> "" Then
FFingerNames(FingerCount) = rsSelect.GetString("name")
Else
FFingerNames(FingerCount) = ""
End If
If rsSelect.GetString("pic") <> "" Then
FFingerPic(FingerCount) = rsSelect.GetString("pic")
Else
FFingerPic(FingerCount) = ""
End If
FingerCount = FingerCount + 1
End While
Catch er As Exception
'do something with the exception
Finally
con.Close()
End Try
End Sub
End Class
|
 |
 |
 |
 |
Date :
2016-06-15 08:47:08 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเอาเม้าส์ไปคลิกที่เส้นแดง ดูถ้า ! มันหาย ก็ rebuild ใหม่ได้เลยครับ
บางที มันสับสน เพราะเราอ้างอิง component แบบ วนไปวนมา
แทนที่จะอ้างอิงแบบ root กลับอ้างอิง แบบ cycle
เวลาคอมไพล์ ตัวหนึ่ง ก็จะทำให้อีกตัวเสียไป มันหา address อ้างอิงไม่เจอ
|
 |
 |
 |
 |
Date :
2016-06-15 09:17:30 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันฟ้อง error control อีกครับ ต้องแก้ไขยังไงครับ


|
 |
 |
 |
 |
Date :
2016-06-15 09:40:16 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตัวนี้ก็ add แล้วนะครับ

|
 |
 |
 |
 |
Date :
2016-06-15 09:42:44 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เป็นแบบนี้ครับ

|
 |
 |
 |
 |
Date :
2016-06-15 10:12:41 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พอเอา ตัว control ZKFPEngX1 มาใช้ จะขึ้น error
reference ไม่ฟ้องแล้วครับ เปลี่ยนมาใช้ vb2008
|
 |
 |
 |
 |
Date :
2016-06-15 10:26:41 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง create project มาใหม่ add ref ใหม่ สร้าง ฟรอร์มใหม่
ลาก control ลงใน ฟอร์มใหม่
ดูยังครับ
|
 |
 |
 |
 |
Date :
2016-06-15 11:31:39 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มีปัญหา คอนโทรล AxZKFPEngX1 คุณ ธนบดี ได้แล้วช่วยหน่อยครับ

|
 |
 |
 |
 |
Date :
2016-06-15 11:53:35 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแล้วครับ เหมือนเดิม
|
 |
 |
 |
 |
Date :
2016-06-15 13:18:43 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง create project มาใหม่ add ref ใหม่ สร้าง ฟรอร์มใหม่
ลาก control ลงใน ฟอร์มใหม่
แล้วยังไม่ได้
อาจจะมองได้ว่า การ add ref นั้นไม่ช่วยไรเลยครับ
น่าจะเกิดจาก ตัว file ref ไม่รองรับ .net รุ่นนั้น ๆ ครับ
ปกติใช้ได้ใช่ไม๊ครับ กับ รุ่นนี้
|
 |
 |
 |
 |
Date :
2016-06-15 13:29:10 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมลองเขียนพึ่งลองเขียน ในนั้น บอกว่ารองรับ .netframwork 3.5
แต่ก็มี sdk อีก ตัวแต่มัน เก็บcashได้แค่ 10 recod ใช้ได้ครับ
|
 |
 |
 |
 |
Date :
2016-06-15 13:54:36 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผม ลด ลงมาใช้ vb.net2005 แล้วก็ยังไม่ได้
|
 |
 |
 |
 |
Date :
2016-06-15 14:04:37 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ZKFPEngX1.CreateFPCacheDB()
ตัวนี้ใช้ยังไงครับ
แต่ control มันชื่อ AxZKFPEngX1
|
 |
 |
 |
 |
Date :
2016-06-15 14:30:09 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เวลาเขียนโปรแกรมส่วนตัวผม ชอบไปปรับ ให้มัน Copy Local ครับจะได้ไม่สับสนว่า เราใช้ .dll จากไหนอยู่จากเครื่องจาก bin/debug
ลองเอาไปประยุกต์ดูนะครับ ผมเดาว่าเราเปลี่ยน target เป็น .netframework 4.0 น่าจะหายนะครับ

|
 |
 |
 |
 |
Date :
2016-06-15 14:37:51 |
By :
bigsuntat |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ปรับตามที่ bigsuntat แล้วนะครับ ยัง error ตัว นี้ เหมือนเดิม งง หรือว่า Biokey.ocx มันไม่ รองรับ win7

|
 |
 |
 |
 |
Date :
2016-06-16 16:04:44 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Imports AxZKFPEngXControl
Imports ZKFPEngXControl
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
ผม ขาด อะไรหรือเปล่า
|
 |
 |
 |
 |
Date :
2016-06-16 16:07:19 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Imports AxZKFPEngXControl
Imports ZKFPEngXControl
เลือกเอาครับว่าจะใช้ ตัวไหน
มันไม่รู้ว่าจะใช้ ฟังก์ชั่นของ component ตัวไหนดี
ชื่อ method มันซ้ำกัน
ปล. ไม่ขาด แต่เกิน 5555
|
ประวัติการแก้ไข 2016-06-16 17:36:54
 |
 |
 |
 |
Date :
2016-06-16 17:34:27 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
BioKey.ocx ตัวนี้ ฟรีไหมครับ การใช้งาน พี่ท่านพี่แนะนำได้บ้าง ผม ลอง จนไปไม่เป็นแล้ว มีตัวไหนแนะบ้าง ไหมครับ
|
 |
 |
 |
 |
Date :
2016-06-22 13:45:13 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เห็นทำมาหลายวันแล้วไม่ได้ซักที ผมเลยลองโหลดเจ้าไฟล์ BioKey.ocx มา Add
สรุปว่าไม่มีแจ้งเตือนใดๆ ครับ

ย้อนกลับไปที่ No. 18
ถ้า create project มาใหม่ add ref ใหม่ สร้าง ฟรอร์มใหม่
ลาก control ลงใน ฟอร์มใหม่ แล้วยังไม่ได้อีก
เป็นผมนี่แก้โดยการ ลง vs ใหม่เลย เสียเวลาแค่ ครึ่งชั่วโมง (แนะนำ 2012 ครับ เพราะผมใช้แล้วมันได้ 5555)
|
 |
 |
 |
 |
Date :
2016-06-23 09:12:07 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เยียมยอด
เดียวผมลอง ดู เวอร์ชั่น 2012
|
 |
 |
 |
 |
Date :
2016-06-23 09:44:55 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง vb2012
ยังเจอ error เหมือนเดิม คุณ
No. 34
TOR_CHEMISTRY ทำไง ครับ

|
 |
 |
 |
 |
Date :
2016-06-23 11:27:48 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
BioKey.ocx ตัวนี้ โหลดมาจากไหน ครับ อันเดียวกันไหมครับ
|
 |
 |
 |
 |
Date :
2016-06-23 11:43:16 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
น่านแหละปัญหาคือผมก็จำไม่ได้อ่าครับ
เอา email มาละกันครับ เดี๋ยวผมจะส่งให้ไปเทศ(ส) ดู
|
 |
 |
 |
 |
Date :
2016-06-23 11:48:31 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากเลยครับ
[email protected]
พิษณุ โทคำเวช
|
 |
 |
 |
 |
Date :
2016-06-23 12:01:08 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยัง error ต้อง add reference ตัวไหน บ้างหนอ ครับ
|
 |
 |
 |
 |
Date :
2016-06-23 13:44:24 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ error แล้วครับ จะดึง ลายนิ้วมือ ออกมาได้ไงครับทีนี้
|
 |
 |
 |
 |
Date :
2016-06-23 13:55:37 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สรุปได้ยังครับว่าเกิดจากอะไร
เผื่อคนอื่นมีปัญหาจะได้เป็นแนวทาง
ส่วน จะดึง ลายนิ้วมือ ยังไง นี่
ผมก็ไม่แน่ใจเหมือนกัน
ต้องดูว่ามันเก็บข้อมูลไว้ยังไงครับ
|
 |
 |
 |
 |
Date :
2016-06-23 14:11:06 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ
เกิดจาก BioKey.ocx ต้องเป็น เวอร์ชัน 4.0 กับ vb2012
แต่ยังไม่รู้วิธี ดึง เก็บลายนิ้วมือ
ขอบคุณ มงคล โพธิ์ชัยหล้า มากครับ
|
 |
 |
 |
 |
Date :
2016-06-23 14:16:02 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มี ตัวอย่าง อ่านลายนิ้วมือ แล้วเก็บลงในฐานข้อมูลหรือเปล่าครับ
|
 |
 |
 |
 |
Date :
2016-06-23 15:20:39 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เป็น vb6 ครับ
|
 |
 |
 |
 |
Date :
2016-06-23 16:01:26 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
น่าจะแกะได้ไม่ค่อยยากนะครับ
ผมว่าตัวนี้ซัก 30 นาที อาจจะมีประโยชน์กว่าที่จะนั่งหาข้อมูลอีกเป็นวันเลยนา
เป็นผมนี่เลือกขี้ที่อยู่ตรงหน้าดีกว่าคว้าทองที่ยังมองไม่เห็นแสงครับ
เอาขี้มาทำเป็นปุ๋ยอย่างดีปลูกผักขายเผลอๆได้ตังเยอะกว่าทองอีก 5555
Code (VB.NET)
Option Explicit
Dim tmplist(0 To 11) As String
Private Sub Form_Load()
'ติดต่อเตรื่องสแกนนิ้มมือ
InitialSensor
'สแกน 1:N
Identify
'กำหนดวันที่
Calendar.Value = Date
'เก็บข้อมูลนิ้วจากฐานช้อมูลเช้าเครื่องสแกน
AddFinger
'ไม่มีรูป
ItemPathNoPic = App.Path & "\pic\00000.jpg"
End Sub
'เก็บข้อมูลนิ้วจากฐานช้อมูลเช้าเครื่องสแกน
Private Sub AddFinger()
Dim sTemp As String
Dim strDataSourcePath As String
Dim rsSelect As New ADODB.Recordset
DataBasePath = App.Path
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DataBasePath & "\dbFingerprint.mdb;Persist Security Info=False"
FingerCount = 0
fpcHandle = ZKFPEngX1.CreateFPCacheDB
rsSelect.Open "Select * from us_userinfo", Conn, adOpenKeyset, adLockOptimistic
rsSelect.MoveFirst
While Not rsSelect.EOF
sTemp = rsSelect.Fields("fpstring")
ZKFPEngX1.AddRegTemplateStrToFPCacheDB fpcHandle, FingerCount, sTemp
ReDim Preserve FFingerCode(FingerCount + 1)
ReDim Preserve FFingerNames(FingerCount + 1)
ReDim Preserve FFingerPic(FingerCount + 1)
If rsSelect.Fields("code").Value <> "" Then
FFingerCode(FingerCount) = rsSelect.Fields("code").Value
Else
FFingerCode(FingerCount) = ""
End If
If rsSelect.Fields("name").Value <> "" Then
FFingerNames(FingerCount) = rsSelect.Fields("name").Value
Else
FFingerNames(FingerCount) = ""
End If
If rsSelect.Fields("pic").Value <> "" Then
FFingerPic(FingerCount) = rsSelect.Fields("pic").Value
Else
FFingerPic(FingerCount) = ""
End If
FingerCount = FingerCount + 1
rsSelect.MoveNext
Wend
rsSelect.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
ZKFPEngX1.FreeFPCacheDB (fpcHandle)
ZKFPEngX1.EndEngine
End Sub
Private Sub LabelExit_Click()
Unload Me
End Sub
Private Sub AddRecord(list As ListBox, newRec As String)
Dim i As Integer
If list.ListCount = 12 Then
list.Clear
End If
list.AddItem newRec, 0
End Sub
Private Sub LabelSetup_Click()
frmLogin.Show vbModal
End Sub
Private Sub Timer1_Timer()
lblTime.Caption = Format(Now, "hh:mm:ss")
End Sub
Private Sub Timer2_Timer()
lblname.Caption = ""
Img.Picture = LoadPicture("")
End Sub
'ค้นหาผลการสแกน
Private Sub ZKFPEngX1_OnCapture(ByVal ActionResult As Boolean, ByVal ATemplate As Variant)
Dim fi As Long, i As Long
Dim Score As Long, ProcessNum As Long
Dim newRec As String
Dim txtfile As String
Dim txtdata As String
If FMatchType = 2 Then
Score = 8
fi = ZKFPEngX1.IdentificationInFPCacheDB(fpcHandle, ATemplate, Score, ProcessNum)
If fi = -1 Then
lblname.Caption = "ไม่พบข้อมูล กรุณาลองใหม่อีกครั้ง"
Img.Picture = LoadPicture("")
Else
lblname.Caption = FFingerCode(fi) & " : " & FFingerNames(fi)
If FFingerPic(fi) = "" Then
FFingerPic(fi) = ItemPathNoPic
End If
Img.Picture = LoadPicture(FFingerPic(fi))
newRec = " " & FFingerCode(fi) & " " & FFingerNames(fi) & " " & Format(Now, "dd-MM-yyyy hh:mm:ss")
AddRecord timelist, newRec
'ตรวจสอบไฟล์เก็บข้อมูล
txtdata = FFingerCode(fi) & Format(Now, "hh:mm")
ChaekFileName Date, txtfile
AddDataToFile txtfile, txtdata
End If
End If
End Sub
Private Sub ZKFPEngX1_OnFeatureInfo(ByVal AQuality As Long)
Dim sTemp As String
If StatusAdd <> 0 Then
If Trim(frmUser.txtid.Text) = "" Then
MsgBox "กรุณาระบุรหัสพนักงานก่อนครับ !!!", vbOKOnly + vbInformation, "ผลการตรวจสอบ"
frmUser.txtid.SetFocus
Exit Sub
End If
If Trim(frmUser.txtname.Text) = "" Then
MsgBox "กรุณาระบุชื่อพนักงานก่อนครับ ! ", vbOKOnly + vbCritical, "พบข้อผิดพลาด"
frmUser.txtname.SetFocus
Exit Sub
End If
If frmUser.StatusBar <> "กรุณาคลิกปุ่ม Save" Then
sTemp = ""
If ZKFPEngX1.IsRegister Then
sTemp = "Ststus of enrollment : " & ZKFPEngX1.EnrollIndex & " fingerprint(s) reserved!"
End If
sTemp = sTemp & "Fingerprint quality"
If AQuality <> 0 Then
sTemp = sTemp & " ไม่ผ่าน " & AQuality
Else
sTemp = sTemp & " ผ่าน"
End If
frmUser.StatusBar.Caption = sTemp
End If
End If
End Sub
Private Sub ZKFPEngX1_OnEnroll(ByVal ActionResult As Boolean, ByVal ATemplate As Variant)
If StatusAdd <> 0 Then
If Trim(frmUser.txtid.Text) = "" Then
MsgBox "กรุณาระบุรหัสพนักงานก่อนครับ !!!", vbOKOnly + vbInformation, "ผลการตรวจสอบ"
frmUser.txtid.SetFocus
Exit Sub
End If
If Trim(frmUser.txtname.Text) = "" Then
MsgBox "กรุณาระบุชื่อพนักงานก่อนครับ ! ", vbOKOnly + vbCritical, "พบข้อผิดพลาด"
frmUser.txtname.SetFocus
Exit Sub
End If
If Not ActionResult Then
frmUser.StatusBar = "บันทึกผิดพลาด"
Else
frmUser.StatusBar = "กรุณาคลิกปุ่ม Save"
ItemFinger = ZKFPEngX1.GetTemplateAsString
End If
End If
End Sub
Code (VB.NET)
Option Explicit
Dim ItemIDOld As String
Dim StateClick As String
Dim ItemUserId As String
Dim ItemUserName As String
Dim ItemUserPic As String
'ล็อก Comments
Private Sub lockctrl()
txtid.Locked = True
txtname.Locked = True
Picture1.Visible = True
Picture2.Visible = True
Picture3.Visible = True
Picture4.Visible = False
Picture5.Visible = False
txtid.BackColor = &H80000000
txtname.BackColor = &H80000000
cmdpic.Enabled = False
cmddeletepic.Enabled = False
mfg.Enabled = True
End Sub
'ปลดล็อก Comments
Private Sub UnLockCtrl()
txtid.Locked = False
txtname.Locked = False
Picture1.Visible = False
Picture2.Visible = False
Picture3.Visible = False
Picture4.Visible = True
Picture5.Visible = True
cmdpic.Enabled = True
cmddeletepic.Enabled = True
txtid.BackColor = &HFFFFFF
txtname.BackColor = &HFFFFFF
mfg.Enabled = False
End Sub
Private Sub cmdAdd_Click()
If frmScan.ZKFPEngX1.Active = True Then
txtid.SetFocus
txtid.Text = ""
txtname.Text = ""
StateClick = "Add"
UnLockCtrl
StatusAdd = 1
ItemUserPic = ""
ItemFinger = ""
Img.Picture = LoadPicture(ItemUserPic)
frmScan.ZKFPEngX1.BeginEnroll
StatusBar.Caption = "เริ่มเก็บลายนิ้วมือ"
Else
MsgBox "เกิดข้อผิดพลาดในการเชื่อมต่อ ไม่สามารถเพิ่มผู้ใช้งานได้!", vbOKOnly + vbCritical, "เกิดข้อผิดพลาด"
End If
End Sub
Private Sub cmdCancel_Click()
lockctrl
StatusAdd = 0
End Sub
Private Sub cmdDelete_Click()
If txtid.Text <> "" Then
DeleteUser txtid.Text
Else
MsgBox "กรุณาคลิก เลือกรายการที่จะ DELETE ก่อน ! ", vbOKOnly + vbInformation, "พบข้อผิดพลาด"
End If
End Sub
'ลบข้อมูล
Private Sub DeleteUser(tmpID As String)
On Error GoTo PictureNotFound
Dim comUpdate As New ADODB.Command
Dim sqlUpdate As String
Conn.BeginTrans
With comUpdate
.ActiveConnection = Conn
.CommandType = adCmdText
End With
sqlUpdate = "DELETE * FROM us_userinfo"
sqlUpdate = sqlUpdate & " Where (code='" & tmpID & "')"
With comUpdate
.CommandText = sqlUpdate
.Execute
End With
If MsgBox("คุณต้อง DELETE พนักงานชื่อ " & txtname.Text & " ใช่หรือไม่?", vbYesNo + vbQuestion, "คำยืนยัน") = vbYes Then
Conn.CommitTrans
'แสดงชื่อ
DisplayUser mfg
With mfg
ItemUserId = (.TextMatrix(1, 0))
ItemUserName = (.TextMatrix(1, 1))
ItemUserPic = (.TextMatrix(1, 2))
ItemFinger = (.TextMatrix(1, 3))
End With
txtid.Text = ItemUserId
txtname.Text = ItemUserName
If ItemUserPic = "" Then
Img.Picture = LoadPicture(ItemPathNoPic)
Else
Img.Picture = LoadPicture(ItemUserPic)
End If
Else
Conn.RollbackTrans
End If
PictureNotFound:
If (Err.Number = 76) Or (Err.Number = 53) Or (Err.Number = 481) Then
ItemUserPic = ""
Img.Picture = LoadPicture(ItemUserPic)
Exit Sub
End If
End Sub
'แสดงรายการในกริด
Public Sub DisplayUser(mfgName As MSHFlexGrid)
Dim sqlSelect As String
Dim rsSelect As New ADODB.Recordset
Dim i As Integer
sqlSelect = "SELECT * FROM us_userinfo ORDER BY code"
With rsSelect
If .State = adStateOpen Then .Close
.ActiveConnection = Conn
.CursorType = adOpenForwardOnly
.CursorLocation = adUseClient
.Open sqlSelect
If .RecordCount <> 0 Then
ClearGrid mfgName
With mfgName
For i = 1 To rsSelect.RecordCount
.TextMatrix(i, 0) = rsSelect.Fields("code").Value
.TextMatrix(i, 1) = rsSelect.Fields("name").Value
If rsSelect.Fields("pic").Value <> "" Then
.TextMatrix(i, 2) = rsSelect.Fields("pic").Value
Else
.TextMatrix(i, 2) = ""
End If
If rsSelect.Fields("fpstring").Value <> "" Then
.TextMatrix(i, 3) = rsSelect.Fields("fpstring").Value
Else
.TextMatrix(i, 3) = ""
End If
rsSelect.MoveNext
.Rows = .Rows + 1
If .Rows > rsSelect.RecordCount Then
.Rows = rsSelect.RecordCount + 1
End If
Next
End With
Else
ClearGrid mfgName
End If
Setmfg mfgName
End With
rsSelect.Close
Set rsSelect = Nothing
End Sub
Private Sub cmddeletepic_Click()
ItemUserPic = ""
Img.Picture = LoadPicture(ItemUserPic)
End Sub
Private Sub cmdEdit_Click()
If frmScan.ZKFPEngX1.Active = True Then
StatusAdd = 1
If txtid.Text <> "" Then
Call UnLockCtrl
ItemIDOld = txtid.Text
StateClick = "Edit"
frmScan.ZKFPEngX1.BeginEnroll
StatusBar.Caption = "เริ่มเก็บลายนิ้วมือ"
Else
MsgBox "กรุณาคลิก รายการที่จะ EDIT ก่อน ! ", vbOKOnly + vbInformation, "พบข้อผิดพลาด"
End If
Else
MsgBox "เกิดข้อผิดพลาดในการเชื่อมต่อ ไม่สามารถแก้ไขผู้ใช้งานได้!", vbOKOnly + vbCritical, "เกิดข้อผิดพลาด"
End If
End Sub
Private Sub cmdpic_Click()
On Error GoTo PictureNotFound
With cdlBrowse
.DialogTitle = "เลือกรูปภาพ"
.CancelError = False
.Action = 1
ItemUserPic = .Filename
End With
If ItemUserPic <> "" Then
Img.Picture = LoadPicture(ItemUserPic)
End If
PictureNotFound:
If (Err.Number = 76) Or (Err.Number = 53) Or (Err.Number = 481) Then
ItemUserPic = ""
Img.Picture = LoadPicture(ItemUserPic)
Exit Sub
End If
End Sub
Private Sub cmdSave_Click()
If StateClick = "Edit" Then
'กรณีแก้ไข
Call UpdateData
Else
'กรณีเพิ่มใหม่
Call AddData
End If
End Sub
Private Sub Form_Load()
On Error GoTo PictureNotFound
If frmScan.ZKFPEngX1.Active = True Then
FMatchType = 0
DisplayUser mfg
lockctrl
If frmScan.ZKFPEngX1.Active = True Then
StatusBar.Caption = "เชื่อมต่อสำเร็จ"
Else
StatusBar.Caption = "การเชื่อมต่อ เกิดข้อผิดพลาด"
End If
With mfg
ItemUserId = (.TextMatrix(1, 0))
ItemUserName = (.TextMatrix(1, 1))
ItemUserPic = (.TextMatrix(1, 2))
ItemFinger = (.TextMatrix(1, 3))
End With
txtid.Text = ItemUserId
txtname.Text = ItemUserName
If ItemUserPic = "" Then
Img.Picture = LoadPicture(ItemPathNoPic)
Else
Img.Picture = LoadPicture(ItemUserPic)
End If
Else
MsgBox "เกิดข้อผิดพลาดในการเชื่อมต่อ กรุณาปิดโปรแกรมแล้วเรียกใช้อีกครั้ง!", vbOKOnly + vbCritical, "เกิดข้อผิดพลาด"
Exit Sub
End If
PictureNotFound:
If (Err.Number = 76) Or (Err.Number = 53) Or (Err.Number = 481) Then
ItemUserPic = ""
Img.Picture = LoadPicture(ItemUserPic)
Exit Sub
End If
End Sub
Private Sub UpdateData()
On Error GoTo DuplicateERROR
Dim comUpdate As New ADODB.Command
Dim sqlUpdate As String
Dim tmpSex As String
If Trim(txtid.Text) = "" Then
MsgBox "กรุณาระบุรหัสพนักงานก่อนครับ !!!", vbOKOnly + vbInformation, "ผลการตรวจสอบ"
txtid.SetFocus
Exit Sub
End If
If Trim(txtname.Text) = "" Then
MsgBox "กรุณาระบุชื่อพนักงานก่อนครับ ! ", vbOKOnly + vbCritical, "พบข้อผิดพลาด"
txtname.SetFocus
Exit Sub
End If
If (Trim(ItemFinger) = "") Then
MsgBox "กรุณากำหนดลายนิ้วมือก่อนครับ !!!", vbOKOnly + vbInformation, "ผลการตรวจสอบ"
Exit Sub
End If
Conn.BeginTrans
With comUpdate
.ActiveConnection = Conn
.CommandType = adCmdText
End With
sqlUpdate = "UPDATE us_userinfo"
sqlUpdate = sqlUpdate & " SET code='" & txtid.Text & "',name='" & txtname.Text & "',"
sqlUpdate = sqlUpdate & " pic='" & ItemUserPic & "',fpstring='" & ItemFinger & "'"
sqlUpdate = sqlUpdate & " Where (code='" & ItemIDOld & "')"
With comUpdate
.CommandText = sqlUpdate
.Execute
End With
If MsgBox("คุณต้องการแก้ไขข้อมูลของพนักงานชื่อ " & txtname.Text & " ใช่หรือไม่?", vbYesNo + vbQuestion, "คำยืนยัน") = vbYes Then
Conn.CommitTrans
ItemIDOld = ""
StatusBar.Caption = ""
'แสดงชื่อพนักงาน
DisplayUser mfg
lockctrl
'เก็บข้อมูลนิ้วจากฐานช้อมูลเช้าเครื่องสแกน
frmScan.ZKFPEngX1.AddRegTemplateStrToFPCacheDB fpcHandle, FingerCount, ItemFinger
ReDim Preserve FFingerCode(FingerCount + 1)
ReDim Preserve FFingerNames(FingerCount + 1)
ReDim Preserve FFingerPic(FingerCount + 1)
FFingerCode(FingerCount) = txtid.Text
FFingerNames(FingerCount) = txtname.Text
FFingerPic(FingerCount) = ItemUserPic
FingerCount = FingerCount + 1
Else
Conn.RollbackTrans
lockctrl
End If
StatusAdd = 0
DuplicateERROR:
If Err.Number = -2147467259 Then
MsgBox "คุณกำหนดรหัสซ้ำ !", vbOKOnly + vbCritical, "เกิดข้อผิดพลาด"
Conn.RollbackTrans
txtid.SetFocus
End If
End Sub
Private Sub AddData()
On Error GoTo DuplicateERROR
Dim comUpdate As New ADODB.Command
Dim sqlUpdate As String
Dim tmpSex As String
If Trim(txtid.Text) = "" Then
MsgBox "กรุณาระบุรหัสพนักงานก่อนครับ !!!", vbOKOnly + vbInformation, "ผลการตรวจสอบ"
txtid.SetFocus
Exit Sub
End If
If Trim(txtname.Text) = "" Then
MsgBox "กรุณาระบุชื่อพนักงานก่อนครับ ! ", vbOKOnly + vbCritical, "พบข้อผิดพลาด"
txtname.SetFocus
Exit Sub
End If
If (Trim(ItemFinger) = "") Then
MsgBox "กรุณากำหนดลายนิ้วมือก่อนครับ !!!", vbOKOnly + vbInformation, "ผลการตรวจสอบ"
Exit Sub
End If
Conn.BeginTrans
sqlUpdate = "INSERT INTO us_userinfo(code,name,pic,fpstring) "
sqlUpdate = sqlUpdate & " VALUES('" & txtid.Text & "','" & txtname.Text & "','" & ItemUserPic & "','" & ItemFinger & "')"
With comUpdate
.ActiveConnection = Conn
.CommandType = adCmdText
.CommandText = sqlUpdate
.Execute
End With
If MsgBox("คุณต้องการเพิ่มพนักงานใหม่ชื่อ " & txtname.Text & " ใช่หรือไม่?", vbYesNo + vbQuestion, "คำยืนยัน") = vbYes Then
Conn.CommitTrans
'แสดงชื่อพนักงาน
StatusBar.Caption = ""
DisplayUser mfg
lockctrl
'เก็บข้อมูลนิ้วจากฐานช้อมูลเช้าเครื่องสแกน
frmScan.ZKFPEngX1.AddRegTemplateStrToFPCacheDB fpcHandle, FingerCount, ItemFinger
ReDim Preserve FFingerCode(FingerCount + 1)
ReDim Preserve FFingerNames(FingerCount + 1)
ReDim Preserve FFingerPic(FingerCount + 1)
FFingerCode(FingerCount) = txtid.Text
FFingerNames(FingerCount) = txtname.Text
FFingerPic(FingerCount) = ItemUserPic
FingerCount = FingerCount + 1
Else
Conn.RollbackTrans
lockctrl
End If
StatusAdd = 0
DuplicateERROR:
If Err.Number = -2147467259 Then
MsgBox "คุณกำหนดรหัสซ้ำ !", vbOKOnly + vbCritical, "เกิดข้อผิดพลาด"
Conn.RollbackTrans
txtid.SetFocus
End If
End Sub
' set รูปแบบ Grid mfg
Public Sub Setmfg(mfgName As MSHFlexGrid)
Dim i As Integer
With mfgName
.ColWidth(0) = 1200
.ColWidth(1) = 1800
.ColWidth(2) = 0
.ColWidth(3) = 0
.TextMatrix(0, 0) = "รหัสพนักงาน"
.TextMatrix(0, 1) = "ชื่อ-สกุล"
.TextMatrix(0, 2) = "ลิ้งรูปภาพ"
.TextMatrix(0, 3) = "ลายนิ้ว"
End With
With mfgName
For i = 0 To 2
.FixedAlignment(i) = flexAlignLeftCenter ' จัดตำหน่งส่วนหัว
.ColAlignment(0) = flexAlignCenterCenter
.ColAlignment(1) = flexAlignLeftCenter
Next
End With
End Sub
Public Sub ClearGrid(mfgName As MSHFlexGrid)
Dim i As Integer
With mfgName
For i = 1 To .Rows - 2
If .Rows > 2 Then
.Rows = .Rows - 1
End If
Next
.Clear
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
StatusAdd = 0
FMatchType = 2
End Sub
Private Sub mfg_Click()
On Error GoTo PictureNotFound
With mfg
ItemUserId = (.TextMatrix(.Row, 0))
ItemUserName = (.TextMatrix(.Row, 1))
ItemUserPic = (.TextMatrix(.Row, 2))
ItemFinger = (.TextMatrix(.Row, 3))
End With
txtid.Text = ItemUserId
txtname.Text = ItemUserName
If ItemUserPic = "" Then
Img.Picture = LoadPicture(ItemPathNoPic)
Else
Img.Picture = LoadPicture(ItemUserPic)
End If
PictureNotFound:
If (Err.Number = 76) Or (Err.Number = 53) Or (Err.Number = 481) Then
ItemUserPic = ""
Img.Picture = LoadPicture(ItemUserPic)
Exit Sub
End If
End Sub
Private Sub mfg_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo PictureNotFound
With mfg
ItemUserId = (.TextMatrix(.Row, 0))
ItemUserName = (.TextMatrix(.Row, 1))
ItemUserPic = (.TextMatrix(.Row, 2))
ItemFinger = (.TextMatrix(.Row, 3))
End With
txtid.Text = ItemUserId
txtname.Text = ItemUserName
If ItemUserPic = "" Then
Img.Picture = LoadPicture(ItemPathNoPic)
Else
Img.Picture = LoadPicture(ItemUserPic)
End If
PictureNotFound:
If (Err.Number = 76) Or (Err.Number = 53) Or (Err.Number = 481) Then
ItemUserPic = ""
Img.Picture = LoadPicture(ItemUserPic)
Exit Sub
End If
End Sub
Code (VB.NET)
Option Explicit
'ติดต่อ DataBase
Public DataBasePath As String
Public Conn As New ADODB.Connection
Public StatusAdd As Integer
Public FTempLen As Integer
Public FRegTemplate As Variant
Public FingerCount As Long
Public fpcHandle As Long
Public FFingerCode() As String 'รหัส
Public FFingerNames() As String 'ชื่อ
Public FFingerPic() As String 'รูป
Public FMatchType As Integer
Public ItemFinger As String 'ลายนิ้ว
Public ItemPathNoPic As String 'ไม่มีรูป
Public Sub InitialSensor()
frmScan.ZKFPEngX1.InitEngine
If frmScan.ZKFPEngX1.Active = True Then
frmScan.ZKFPEngX1.SensorIndex = 1
frmScan.ZKFPEngX1.EnrollCount = 3
frmScan.lblon.Visible = False
frmScan.lbloff.Visible = True
Else
frmScan.lblon.Visible = True
frmScan.lbloff.Visible = False
End If
End Sub
Public Sub Identify()
If frmScan.ZKFPEngX1.IsRegister Then
frmScan.ZKFPEngX1.CancelEnroll
End If
FMatchType = 2
End Sub
' ฟังก์ชั่นเปลี่ยน พ.ศ. ให้เป็น ค.ศ. และรูปแบบวันที่และเวลา
Public Function TimeThaiFormat(EngTime As Date) As Date
Dim tmpYear As String
Dim tmpDate As String
Dim tmpmonth As String
Dim tmptime As String
tmptime = CStr(Format(EngTime, " HH:mm:ss"))
tmpYear = DatePart("yyyy", EngTime)
tmpDate = DatePart("d", EngTime)
If Len(tmpDate) = 1 Then
tmpDate = "0" & tmpDate
Else
tmpDate = tmpDate
End If
tmpmonth = DatePart("m", EngTime)
If Len(tmpmonth) = 1 Then
tmpmonth = "0" & tmpmonth
Else
tmpmonth = tmpmonth
End If
TimeThaiFormat = tmpYear & "-" & tmpmonth & "-" & tmpDate & tmptime
End Function
'ตรวจสอบไฟล์เก็บข้อมูล
Public Function ChaekFileName(tmptime As Date, tmpResult As String)
Dim tmpYear As String
Dim tmpDate As String
Dim tmpmonth As String
tmpYear = DatePart("yyyy", tmptime)
tmpYear = Right(tmpYear, Len(tmpYear) - 2)
tmpDate = DatePart("d", tmptime)
If Len(tmpDate) = 1 Then
tmpDate = "0" & tmpDate
Else
tmpDate = tmpDate
End If
tmpmonth = DatePart("m", tmptime)
If Len(tmpmonth) = 1 Then
tmpmonth = "0" & tmpmonth
Else
tmpmonth = tmpmonth
End If
tmpResult = tmpYear & tmpmonth & tmpDate
End Function
'เช็คว่ามีไฟล์หรือยัง ถ้ามีให้เพิ่มรายการได้
Public Sub AddDataToFile(tmpFile As String, tmpdata As String)
On Error GoTo CreatFile
Dim PathFileini As String
Dim tmpFreeFile As Integer
PathFileini = DataBasePath
If Right$(PathFileini, 1) <> "\" Then
PathFileini = PathFileini & "\data\"
End If
PathFileini = PathFileini & tmpFile & ".txt"
tmpFreeFile = FreeFile
Open PathFileini For Append As #tmpFreeFile
Print #tmpFreeFile, tmpdata
Close
CreatFile:
Select Case Err.Number
Case 53 ' ถ้าไม่มีไฟล์ให้สร้างใหม่
CreateFile tmpFile
End Select
End Sub
Public Sub CreateFile(tmpFile As String)
Dim Filename As String
Dim memFreeFile As String
Dim PathFile As String
memFreeFile = FreeFile
PathFile = DataBasePath
If Right$(PathFile, 1) <> "\" Then
PathFile = PathFile & "\data\"
End If
Filename = "" & PathFile & tmpFile & ".txt"
Open Filename For Append As #memFreeFile
Close
End Sub
|
 |
 |
 |
 |
Date :
2016-06-23 16:28:09 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาข้อมูลจากเครื่องแสนออกมาออก มาโชว์ได้ นี้จะไปต่อได้ เลยนะนี้
ตอนแสกน รับข้อมูลยังไง งง ครับ
|
 |
 |
 |
 |
Date :
2016-06-24 11:05:08 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเขียนโค้ดทั้งหมดตามนั้นยังละครับ
คุ้นๆว่าถ้าเขียนครบมันก็จะได้เลย นะครับ(ลองแกะดู)
|
 |
 |
 |
 |
Date :
2016-06-24 11:16:36 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มีทั้ง ฟอร์ม เลยไหม 55 ไล่ code ตา ลาย เลยตอนนี้ หา ตัว ดึง มาจากเครื่อง แสกน 
|
 |
 |
 |
 |
Date :
2016-06-24 11:54:19 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
code ตัวอย่าง ยังมี error

ลอง code เชื่อมต่อ เครื่องแสกนลายนิ้วมือ

|
 |
 |
 |
 |
Date :
2016-06-24 14:09:37 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอ...เหมือนจะมีให้โหลดนะ
โหลดมาครบป่าวครับ
แต่ก็นับถือนะแกะโค้ดจนใกล้เสรจแล้วนิครับ
|
 |
 |
 |
 |
Date :
2016-06-24 14:27:32 |
By :
lamaka.tor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
กลับอีก ครั้ง ยังไม่ได้เลย พี่ๆ ท่าน ทำสำเร็จแล้ว ช่วยหน่อยครับ เก็บ ลายนิ้วมือ
|
 |
 |
 |
 |
Date :
2016-07-26 11:12:09 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
1. ไปที่ เมนู Tools
2. ไปที่ เมนู Choose Toolbox Items
3. ไปที่ Tab COM Components
4. Browse Biokey.ocx
ก็จะได้ครับ และเวลาที่ใช้งาน ตอนติดตั้งโปรแกรมต้องมี
Copy AxInterop.ZKFPEngXControl.dll
Interop.ZKFPEngXControl.dll
Biokey.ocx
ของผมเขียนติดต่อ Time One
ติดอย่างไรเมล์มาได้ครับ
|
 |
 |
 |
 |
Date :
2016-08-04 18:42:32 |
By :
thaweewong |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอ mail หน่อยครับ thaweewong
[email protected]
|
 |
 |
 |
 |
Date :
2016-08-05 14:06:57 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สวัสดีครับ คุณ thaweewong ผมติดปัญหา add referent แล้ว มันฟ้อง error ผมใช้ vb.net2010
ใช้ u are 4500
Biokey.ocx
ใช้ อ่านข้อมูลออกมาจาก เครื่องแสกน ยังไงครับ
ยังไปไม่เป็นครับ ช่วยหน่อยครับ
|
 |
 |
 |
 |
Date :
2016-08-05 14:31:20 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

พี่ครับ ช่วยดู code นี้ด้วยครับ
|
 |
 |
 |
 |
Date :
2016-08-08 13:49:32 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
Public Function Connection() As String()
axZKFPEngX1.FPEngineVersion = "9"
izkfpver = axZKFPEngX1.FPEngineVersion
axZKFPEngX1.SensorIndex = 0
If AxZKFPEngX1.InitEngine() = 0 Then
Try
Value(0) = "Connect"
Value(1) = "Finger Serial Number :" + AxZKFPEngX1.SensorSN.ToString()
Value(2) = "Finger Count :" + AxZKFPEngX1.SensorCount.ToString()
Value(3) = "Finger Index :" + AxZKFPEngX1.SensorIndex.ToString()
Value(4) = "ImageWidth Record :" + AxZKFPEngX1.ImageWidth.ToString()
Value(5) = "ImageHeight Record :" + AxZKFPEngX1.ImageHeight.ToString()
isConnected = True
fpcHandle = AxZKFPEngX1.CreateFPCacheDB()
Catch
AxZKFPEngX1.EndEngine()
Value(0) = "Disconnect"
Value(1) = ""
Value(2) = ""
Value(3) = ""
Value(4) = ""
Value(5) = ""
isConnected = False
End Try
End If
Return Value
End Function

ไม่สามารถติดต่อ กับ แสกน ได้ ทำไมมัน error
|
 |
 |
 |
 |
Date :
2016-08-10 14:54:07 |
By :
pitsanu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อยากได้ตัวอย่างที่เป็น c# รบกวนแนะนำด้วยครับ
|
 |
 |
 |
 |
Date :
2017-01-10 10:03:45 |
By :
mailo_sa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอ mail หน่อยครับ thaweewong
[email protected]
|
 |
 |
 |
 |
Date :
2017-01-10 11:51:50 |
By :
mailo_sa |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สวัสดีครับพี่ๆ พอดีสนใจทำโปรเจคเกี่ยวกับ VB.net กับ เครื่องสแกนลายนิ้มมือครับ อยากจะรบกวนขอโค้ดตัวอย่างด้วยครับ
เมลล์ : [email protected]
ขอบคุณ ล่วงหน้าครับ
|
 |
 |
 |
 |
Date :
2017-05-26 17:50:47 |
By :
sjoconnor |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สวัสดีครับ พี่ๆ ทุกคน ผมสนใจโปรแกรมสแกนลายนิ้วมือ อยากจะขอ code ตัวอย่าง มีศึกษาครับ
Mail : [email protected]
ขอบพระคุณอย่างสูงครับ
|
 |
 |
 |
 |
Date :
2017-07-31 09:27:53 |
By :
aekcub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันไม่เข้า Event AxZKFPEngX1_OnCapture และ AxZKFPEngX1_OnEnroll
แต่เข้า AxZKFPEngX1_OnFingerTouching ,AxZKFPEngX1_OnImageReceived
ไม่ทราบเป็นที่อะไร รบกวนหน่วยค่ะ
|
 |
 |
 |
 |
Date :
2018-03-16 15:17:25 |
By :
FP |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|