Giter Club home page Giter Club logo

zkteco_pullsdk_wrapper's People

Contributors

muaazh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zkteco_pullsdk_wrapper's Issues

I have a problem when using the code for the problem of opening the door multiple times

After a while of using the library, I'm encountering some problems. Below is my code:

public void btn_conectar_Click(object sender, EventArgs e)
{
    if (btn_Connect.Text == "Connect")
    {
        foreach (var item in _currentSettings)
        {
            item.AccessPanelData = new AccessPanel();
            // connect
            if (!item.AccessPanelData.Connect(item.IP, item.Port.Value, 0, item.TimeOuts.Value))
            {
                logger.Information("Cannot connect:" + item.IP);
                MessageBox.Show("Cannot connect this ip " + item.IP + ". Error", "Infomation", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                logger.Information("Start with IP:" + item.IP);
               //call function run backgroud
                Task.Run(() => BackgroundTask(item));
            }
        }
        btn_Connect.Text = "Disconnect";
    }
    else
    {
        foreach (var item in _currentSettings)
        {
            item.AccessPanelData.Disconnect();
        }
        listBoxActive.Items.Clear();
        btn_Connect.Text = "Connect";
    }
}

//Create thread run backgroud
async Task BackgroundTask(Settings setting)
{
    while (setting.IsActive)
    {
        await Task.Delay(1000);
        var listLog = csetting.AccessPanelData.GetEventLog();
        if (listLog != null && listLog.Events != null)
        {
            var list = listLog.Events;
            foreach (var item in list)
            {
                if (list_log1.Items.Count > 20)
                {
                    list_log1.Invoke(new MethodInvoker(() => list_log1.Items.Clear()));
                }

                list_log1.Invoke(new MethodInvoker(() =>
                {
                    list_log1.Items.Add(setting.IP);
                    var index = list_log1.Items.Count - 1;
                    list_log1.Items[index].SubItems.Add(item.Time);
                    list_log1.Items[index].SubItems.Add(item.Pin);
                    list_log1.Items[index].SubItems.Add(item.inputString);
                    list_log1.Items[index].SubItems.Add(item.Door);
                    list_log1.Items[index].SubItems.Add(item.EventType.ToString());
                    list_log1.Items[index].SubItems.Add(item.InOrOut.ToString());
                    list_log1.Items[index].SubItems.Add("");
                    list_log1.Items[index].SubItems.Add("");
                }));
               //item.inputString is code I will check to access open door
                if (item.inputString.Length > 5 && setting.intPtr != IntPtr.Zero)
                {
                  // call function check true false can access open door
                    var ticket = await ServiceConnection.CheckTicketAsync(item.inputString, setting.IP);
                    if (CheckCong(item.inputString, setting.IP) && ticket.ActiveID != null)
                    {
                            //create another thread to open Door
                           var task = Task.Run(async () =>
                            {
                              //NumberOfOpenDoor > 1 Open the door multiple times, each time 3 seconds apart 
                                for (int k = 0; k < ticket.NumberOfOpenDoor; k++)
                                {
                                    setting.AccessPanelData.OpenDoor(1, 1);
                                   //wait 3s
                                    await Task.Delay(3000);
                                }
                            });
                            await task;
                    }
                }
            }
        }
    }
}

The above code works normally, but there is a problem that when used to open the door multiple times, the next time will have to wait the entire time of the first time.
For example, code 1234 opens the door 10 times after opening the door 3 seconds apart as set.
When using code 1235, you will have to wait 10*3=30 seconds for the system to continue opening.
i think the problem is await Task.Delay(3000); must not be removed.
Do you have any way to optimize this problem? Solve the problem of opening the door multiple times when using 1 code.

DllRegisterServe dll Com interface !

Can I use your DLL files as com interfaces for interaction in other programs? I tried to register your libraries via regsvr32 but I always get the DllRegisterServer error. I also tried to register libzkfp.dll and libzkfpcsharp.dll but without success, even though they are in the C folder: \Windows\SysWOW64

can't connect to the c3 device

while trying to connect to the device via the code
`using PullSDK_core;

AccessPanel device = new AccessPanel();

// connect
if (!device.Connect("192.168.1.201", 4370, 123456, 5000)) {
return; // could not connect
}`
i get this Exception
Unhandled exception. System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (0x8007000B)

i am using x64 bit OS

Cant import PullSDK properly

Hi, I'm using Visual Studio 2022 and .NET 8.

I placed the DLLs in these folders:
fayllar1
fayllar2
After this, I imported these DLLs into my project using this menu:
fayllar4

However, I always get the same result. After launching the application with F5, I encounter this error:
fayllar3

I can't install it

I am trying to install it but it kept closing the doors.
Could you provide more details about the intallation process.

all respect.

Unable to Connect

I wanted to try your wrapper but I can't get it to connect to my access cards. I put up an example repo of how I am attempting to use it at https://github.com/valeryan/zk-access-control

I have 2 US-C3-400-PROs on my local network at 192.168.1.100 and 101. I can ping the cards but when I try to connect to them using your wrapper I can't get a connection. I have the zkaccess software installed and I can connect to the devices with the software. I have confirmed in the software that the cards are configured for port 4370 and have no password set.

I believe the C3 cards are compatible with PullSDK.

Do you have any suggestions?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.