ผมได้ SDK มาจากตัวแทนแล้วแต่ยังไม่เข้าใจว่าจะเรียก Function ใช้งานอย่างไรเนื่องจากไม่เคยใช้มาก่อน Function มีค่าพารามิเตอร์
ชนิด Long FAR* ซึ่งผมไม่เคยใช้มาก่อน เข้าใจว่าเป็น Data Type ใน C
SDK มีหลาย Function แต่ผมคงใช้แค่ 2 Function เท่านั้น ตามมนี้นะครับ
[center]SB100PC OCX
User’s Manual
2008. 4
[/center]
FK526KMS OCX Manual
==========================================================================================
1.1 Function “ReadAllGLogData”
[Function] Function “ReadAllGLogData” is used to read all of the recorded attendance data from the specified terminal and store them in the internal memory.
[Format] BOOL ReadAllGLogData ( Long dwMachineNumber )
[Parameter] dwMachineNumber : It stands for the ID number of the terminal to read the data from.
[Return Value] It is TRUE when the efficient data has been read from the specified terminal.
It would be FALSE if the specified terminal does not exist, it does not have any attendance data recorded on it or an error has occurred to the data communication.
[Attention] Function “ReadAllGLogData” reads all of the attendance data out from the specified terminal and stores them in the internal memory.
Unlike “ReadGeneralLogData”, this function also reads the attendance data which have ever been read before as well as the newly-recorded ones as long as they have not been deleted.
Using function “GetAllGLogData”, the user can get the data stored in the internal memory.
==========================================================================================
1.2 Function “GetDrAllGLogData”
[Function] Function “GetDrAllGLogData” is used to get all of the attendance data from the internal memory.
[Format] BOOL GetDrAllGLogData (
Long dwMachineNumber,
Long FAR* dwTMachineNumber ,
Long FAR* dwEnrollNumber ,
Long FAR* dwEMachineNumber ,
Long FAR* dwVerifyMode ,
Long FAR* dwYear,
Long FAR* dwMonth,
Long FAR* dwDay,
Long FAR* dwHour,
Long FAR* dwMinute
LongFAR* dwEvent);
[Attention] The function gets the data which function “ReadAllGLogData” read from the specified terminal and stored in the internal memory.
The method of using this function is the same as that of “GetDrGeneralLogData”.
Execution of this function has nothing to do with the value of “ReadMark property”.
==========================================================================================
Function “ReadAllGLogData” พอเข้าใจว่าอ่านข้อมูลเข้าหน่วยความจำจากนั้นใช้ Function “GetDrAllGLogData” อ่านข้อมูลจาก memory Parameter ต่างๆที่เป็น Long FAR* ต้องเขียนอย่างไร, ค่า dwVerifyMode , ค่า Long FAR* dwEMachineNumber ,,LongFAR* dwEvent พวกนี้ต้องกำหนดอย่างไร รบกวนท่านที่มีความรู้ช่วยด้วยครับ
คราวนี้ขึ้นครับ
ตัวอย่าง Code ที่ผมมีนะครับ
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using zkemkeeper;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int count = 0;
zkemkeeper.CZKEMClass axczkem1 = new zkemkeeper.CZKEMClass();
bool bIsConnected = false;
string ip = "192.168.140.254";//write here IP Address of your biomatric m/c
int port = 4370;
bIsConnected = axczkem1.Connect_Net(ip, port);
if (bIsConnected == true)
{
MessageBox.Show("Connection established!!!" );
bool ret = axczkem1.ReadAllGLogData(1);
if (ret)
{
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int ee = 0;
int f = 0;
int g = 0;
int h = 0;
int i = 0;
int j = 0;
int k = 0;
int l = 0;
int m = 0;
int n = 0;
int o = 0;
while (axczkem1.GetAllGLogData (1, ref a, ref b, ref c, ref k, ref l, ref d, ref m, ref ee, ref f, ref g))
{
if (ee == 7 && m == 4 && d == 2011)
{
count++;
if (b == //any Employee No)
{
MessageBox.Show(b.ToString() + " hour: " + f + " Min: " + g);
MessageBox.Show(k.ToString() + " " + l.ToString());