Пример #1
0
        private bool Init()
        {
            devIdList.Clear();
            cbbDevice.Items.Clear();

            for (int i = 0; i < ObjFpReader.PISFP_MAX_DEVICE_COUNTS; i++)
            {
                byte[] vstrDeviceDescription = new byte[1024];
                byte[] vstrDevId             = new byte[1024];

                if (ObjFpReader.pisEnumerateDevice(i, vstrDevId, vstrDeviceDescription) == ObjFpReader.PISFP_OK)
                {
                    string str = Encoding.UTF8.GetString(vstrDeviceDescription, 0, vstrDeviceDescription.Length);
                    cbbDevice.Items.Add(str);
                    devIdList.Add(Encoding.UTF8.GetString(vstrDevId, 0, vstrDevId.Length));
                }
            }

            if (cbbDevice.Items.Count > 0)
            {
                InitFlag = true;
                cbbDevice.SelectedIndex = 0;
                InitFlag = false;
                Application.DoEvents();
                return(true);
            }

            return(false);
        }